@@ -117,22 +117,30 @@ export type SessionState = $ReadOnly<{|
117117// PerAccountSessionState is inexact.)
118118( s : SessionState ) : PerAccountSessionState => s ; // eslint-disable-line no-unused-expressions
119119
120- const initialState : SessionState = {
121- eventQueueId : null ,
122-
120+ const initialGlobalSessionState : $Exact < GlobalSessionState > = {
123121 // This will be `null` on startup, while we wait to hear `true` or `false`
124122 // from the native module over the RN bridge; so, have it start as `null`.
125123 isOnline : null ,
126124
127125 isHydrated : false ,
128- loading : false ,
129126 orientation : 'PORTRAIT' ,
130- outboxSending : false ,
131127 pushToken : null ,
132128 debug : Object . freeze ( { } ) ,
129+ } ;
130+
131+ /** PRIVATE; exported only for tests. */
132+ export const initialPerAccountSessionState: $Exact< PerAccountSessionState > = {
133+ eventQueueId : null ,
134+ loading : false ,
135+ outboxSending : false ,
133136 hasDismissedServerCompatNotice : false ,
134137} ;
135138
139+ const initialState: SessionState = {
140+ ...initialGlobalSessionState ,
141+ ...initialPerAccountSessionState ,
142+ } ;
143+
136144// eslint-disable-next-line default-param-last
137145export default (state: SessionState = initialState, action: Action): SessionState => {
138146 switch ( action . type ) {
@@ -149,6 +157,9 @@ export default (state: SessionState = initialState, action: Action): SessionStat
149157 case LOGIN_SUCCESS:
150158 return {
151159 ...state ,
160+ loading : false ,
161+ outboxSending : false ,
162+ hasDismissedServerCompatNotice : false ,
152163
153164 // We're about to request a new event queue; no use hanging on to
154165 // any old one we might have.
@@ -159,6 +170,8 @@ export default (state: SessionState = initialState, action: Action): SessionStat
159170 return {
160171 ...state ,
161172 loading : false ,
173+ outboxSending : false ,
174+ hasDismissedServerCompatNotice : false ,
162175
163176 // Stop polling this event queue.
164177 eventQueueId : null ,
@@ -168,6 +181,8 @@ export default (state: SessionState = initialState, action: Action): SessionStat
168181 return {
169182 ...state ,
170183 loading : false ,
184+ outboxSending : false ,
185+ hasDismissedServerCompatNotice : false ,
171186
172187 // Stop polling this event queue. (We'll request a new one soon,
173188 // for the new account.)
0 commit comments