mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
6cc9ce8094
Avoids new user getting asked if they want to cancel registration of a piece before they even agree to the Ikono contract.
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
import { alt } from '../alt';
|
|
|
|
import NotificationActions from '../actions/notification_actions';
|
|
|
|
|
|
class NotificationStore {
|
|
constructor() {
|
|
this.pieceListNotifications = {};
|
|
this.editionListNotifications = {};
|
|
// Need to determine if contract agreement notifications have been loaded or not,
|
|
// so we use null here instead of an empty array
|
|
this.contractAgreementListNotifications = null;
|
|
this.editionNotifications = null;
|
|
this.pieceNotifications = null;
|
|
this.bindActions(NotificationActions);
|
|
}
|
|
|
|
onUpdatePieceListNotifications(res) {
|
|
this.pieceListNotifications = res.notifications;
|
|
}
|
|
|
|
onFlushPieceListNotifications() {
|
|
this.pieceListNotifications = [];
|
|
}
|
|
|
|
onUpdatePieceNotifications(res) {
|
|
this.pieceNotifications = res.notification;
|
|
}
|
|
|
|
onUpdateEditionListNotifications(res) {
|
|
this.editionListNotifications = res.notifications;
|
|
}
|
|
|
|
onFlushPieceListNotifications() {
|
|
this.editionListNotifications = [];
|
|
}
|
|
|
|
onUpdateEditionNotifications(res) {
|
|
this.editionNotifications = res.notification;
|
|
}
|
|
|
|
onUpdateContractAgreementListNotifications(res) {
|
|
this.contractAgreementListNotifications = res.notifications;
|
|
}
|
|
|
|
onFlushContractAgreementListNotifications() {
|
|
this.contractAgreementListNotifications = null;
|
|
}
|
|
}
|
|
|
|
export default alt.createStore(NotificationStore, 'NotificationStore');
|