@@ -20,19 +20,6 @@ import { identityOfAccount, keyOfIdentity } from './accountMisc';
2020
2121const initialState = NULL_ARRAY ;
2222
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-
3623const findAccount = ( state : AccountsState , identity : Identity ) : number => {
3724 const { realm, email } = identity ;
3825 return state . findIndex (
@@ -95,7 +82,18 @@ const unackPushToken = (state, action) => {
9582export default ( state : AccountsState = initialState , action : Action ) : AccountsState => {
9683 switch ( action . type ) {
9784 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+ ] ;
9997
10098 case ACCOUNT_SWITCH : {
10199 const index = state . findIndex (
0 commit comments