Added: Collection to starred view

Alphabetical sort to starred view
This commit is contained in:
Tom Moor
2018-11-19 23:01:49 -08:00
parent 2c55f94d39
commit ecc7ba0e9d
4 changed files with 38 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import { observable, action, computed, ObservableMap, runInAction } from 'mobx';
import { client } from 'utils/ApiClient';
import { map, find, orderBy, filter, uniq } from 'lodash';
import { map, find, orderBy, filter, uniq, sortBy } from 'lodash';
import invariant from 'invariant';
import BaseStore from 'stores/BaseStore';
@@ -81,6 +81,11 @@ class DocumentsStore extends BaseStore {
return filter(this.data.values(), 'starred');
}
@computed
get starredAlphabetical(): Document[] {
return sortBy(this.starred, doc => doc.title.toLowerCase());
}
@computed
get drafts(): Document[] {
return filter(