@@ -20,19 +20,6 @@ import { identityOfAccount, keyOfIdentity } from './accountMisc';
20
20
21
21
const initialState = NULL_ARRAY ;
22
22
23
- const registerComplete = ( state , action ) => [
24
- {
25
- ...state [ 0 ] ,
26
- userId : action . data . user_id ,
27
- zulipFeatureLevel : action . data . zulip_feature_level ,
28
- zulipVersion : action . data . zulip_version ,
29
- lastDismissedServerPushSetupNotice : action . data . realm_push_notifications_enabled
30
- ? null
31
- : state [ 0 ] . lastDismissedServerPushSetupNotice ,
32
- } ,
33
- ...state . slice ( 1 ) ,
34
- ] ;
35
-
36
23
const findAccount = ( state : AccountsState , identity : Identity ) : number => {
37
24
const { realm, email } = identity ;
38
25
return state . findIndex (
@@ -95,7 +82,18 @@ const unackPushToken = (state, action) => {
95
82
export default ( state : AccountsState = initialState , action : Action ) : AccountsState => {
96
83
switch ( action . type ) {
97
84
case REGISTER_COMPLETE :
98
- return registerComplete ( state , action ) ;
85
+ return [
86
+ {
87
+ ...state [ 0 ] ,
88
+ userId : action . data . user_id ,
89
+ zulipFeatureLevel : action . data . zulip_feature_level ,
90
+ zulipVersion : action . data . zulip_version ,
91
+ lastDismissedServerPushSetupNotice : action . data . realm_push_notifications_enabled
92
+ ? null
93
+ : state [ 0 ] . lastDismissedServerPushSetupNotice ,
94
+ } ,
95
+ ...state . slice ( 1 ) ,
96
+ ] ;
99
97
100
98
case ACCOUNT_SWITCH : {
101
99
const index = state . findIndex (
0 commit comments