1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Use empty array as initial state of piece and edition list notifications

This commit is contained in:
Brett Sun 2015-12-16 10:24:44 +01:00
parent 5e6b483149
commit 874aad05b8
3 changed files with 8 additions and 6 deletions

View File

@ -12,8 +12,8 @@ class NotificationActions {
'flushPieceListNotifications', 'flushPieceListNotifications',
'updateEditionListNotifications', 'updateEditionListNotifications',
'flushEditionListNotifications', 'flushEditionListNotifications',
'updateEditionNotifications',
'updatePieceNotifications', 'updatePieceNotifications',
'updateEditionNotifications',
'updateContractAgreementListNotifications', 'updateContractAgreementListNotifications',
'flushContractAgreementListNotifications' 'flushContractAgreementListNotifications'
); );

View File

@ -16,7 +16,7 @@ let NotificationFetcher = {
fetchEditionListNotifications() { fetchEditionListNotifications() {
return requests.get('notification_editionlist'); return requests.get('notification_editionlist');
}, },
fetchEditionNotifications(editionId) { fetchEditionNotifications(editionId) {
return requests.get('notification_edition', {'edition_id': editionId}); return requests.get('notification_edition', {'edition_id': editionId});
}, },

View File

@ -8,13 +8,15 @@ import NotificationActions from '../actions/notification_actions';
class NotificationStore { class NotificationStore {
constructor() { constructor() {
this.pieceListNotifications = {}; this.pieceListNotifications = [];
this.editionListNotifications = {}; this.pieceNotifications = null;
this.editionListNotifications = [];
this.editionNotifications = null;
// Need to determine if contract agreement notifications have been loaded or not, // Need to determine if contract agreement notifications have been loaded or not,
// so we use null here instead of an empty array // so we use null here instead of an empty array
this.contractAgreementListNotifications = null; this.contractAgreementListNotifications = null;
this.editionNotifications = null;
this.pieceNotifications = null;
this.bindActions(NotificationActions); this.bindActions(NotificationActions);
} }