restore()

in src/app/work-items-filter.js [22:41]


  restore(props) {
    try {
      const filter = props.configWrapper.getFieldValue('filter');
      const WEEK_AGO = -7;
      this.query = filter.query;
      this.folder = filter.folder;

      this.workTypes = filter.workTypes || [];
      this.withoutWorkType = filter.withoutWorkType || false;

      this.startDate = filter.startDate ? parse(filter.startDate, FORMAT) : addDays(new Date(), WEEK_AGO);
      this.endDate = filter.endDate ? parse(filter.endDate, FORMAT) : new Date();

      this.authors = filter.authors || [];
      this.authorGroups = filter.authorGroups || [];

    } catch (e) {
      this.sync(props);
    }
  }