-
Notifications
You must be signed in to change notification settings - Fork 0
/
manageElection.ts
36 lines (30 loc) · 1.09 KB
/
manageElection.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* State used on the manage election interface
*/
import { apiLoading, APIResult, apiSuccess } from 'api';
import { PublicElectionDetails } from 'models/election';
import { PublicCollectorList } from 'models/mediator';
export interface ManageElectionState {
electionDetails: APIResult<PublicElectionDetails>;
allCollectors: APIResult<PublicCollectorList[]>;
electionCollectors: APIResult<PublicCollectorList[]>;
deletingElection: APIResult<boolean>;
publishingElection: APIResult<boolean>;
registering: APIResult<boolean>;
openingVoting: APIResult<boolean>;
closingVoting: APIResult<boolean>;
pickCollectorsModalOpen: boolean;
collectorsSelected: Set<string>;
}
export const initialManageElectionState: ManageElectionState = {
electionDetails: apiLoading(),
allCollectors: apiLoading(),
electionCollectors: apiLoading(),
deletingElection: apiSuccess(false),
publishingElection: apiSuccess(false),
registering: apiSuccess(false),
openingVoting: apiSuccess(false),
closingVoting: apiSuccess(false),
pickCollectorsModalOpen: false,
collectorsSelected: new Set(),
};