addSegmentEffortToActivity(activityId, effortRaw) {
    if (!this.activities[activityId]) {
      return;
    }
    const newSegmentEffort = this.formatSegmentEffort(effortRaw);
    if (newSegmentEffort) {
      const segment_efforts = this.activities[activityId].segment_efforts
        ? [...this.activities[activityId].segment_efforts, newSegmentEffort]
        : [newSegmentEffort];

      // Would be preferable to dedupe after all segment efforts have been added
      // but that would require changing a bunch of logic in this class
      this.activities[activityId].segment_efforts = dedupeSegmentEfforts(
        segment_efforts,
      );
    }
  }
/**
   * Append new segment effort to an activity
   */
Append new segment effort to an activity
Append new segment effort to an activity
addSegmentEffortToActivity(activityId, effortRaw) {
    if (!this.activities[activityId]) {
      return;
    }
    const newSegmentEffort = this.formatSegmentEffort(effortRaw);
    if (newSegmentEffort) {
      const segment_efforts = this.activities[activityId].segment_efforts
        ? [...this.activities[activityId].segment_efforts, newSegmentEffort]
        : [newSegmentEffort];
      this.activities[activityId].segment_efforts = dedupeSegmentEfforts(
        segment_efforts,
      );
    }
  }
addSegmentEffortToActivity ( activityId , effortRaw ) { if ( ! this . activities [ activityId ] ) { return ; } const newSegmentEffort = this . formatSegmentEffort ( effortRaw ) ; if ( newSegmentEffort ) { const segment_efforts = this . activities [ activityId ] . segment_efforts ? [ ... this . activities [ activityId ] . segment_efforts , newSegmentEffort ] : [ newSegmentEffort ] ; this . activities [ activityId ] . segment_efforts = dedupeSegmentEfforts ( segment_efforts , ) ; } }
Append new segment effort to an activity
Append new segment effort to an activity
// Would be preferable to dedupe after all segment efforts have been added // but that would require changing a bunch of logic in this class