Move sorted contributors to kredits service

This commit is contained in:
2020-08-12 22:51:52 +02:00
parent ef0fc11edf
commit f63d14d7b4
4 changed files with 18 additions and 7 deletions
+5 -1
View File
@@ -4,7 +4,7 @@ import Kredits from 'kredits-contracts';
import Service from '@ember/service';
import EmberObject from '@ember/object';
import { computed } from '@ember/object';
import { alias, notEmpty } from '@ember/object/computed';
import { alias, filterBy, notEmpty, sort } from '@ember/object/computed';
import { isEmpty, isPresent } from '@ember/utils';
import { inject as service } from '@ember/service';
@@ -39,6 +39,10 @@ export default Service.extend({
currentUserIsCore: alias('currentUser.isCore'),
hasAccounts: notEmpty('currentUserAccounts'),
contributorsMined: filterBy('contributors', 'id'),
contributorsSorting: Object.freeze(['name:asc']),
contributorsSorted: sort('contributorsMined', 'contributorsSorting'),
// When data was loaded from cache, we need to fetch updates from the network
contributorsNeedSync: false,
contributionsNeedSync: false,