diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js --- a/lib/reducers/calendar-filters-reducer.js +++ b/lib/reducers/calendar-filters-reducer.js @@ -1,5 +1,6 @@ // @flow +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { newThreadActionTypes, joinThreadActionTypes, @@ -47,6 +48,7 @@ action.type === logOutActionTypes.success || action.type === deleteAccountActionTypes.success || action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success || (action.type === setNewSessionActionType && action.payload.sessionChange.cookieInvalidated) diff --git a/lib/reducers/connection-reducer.js b/lib/reducers/connection-reducer.js --- a/lib/reducers/connection-reducer.js +++ b/lib/reducers/connection-reducer.js @@ -2,6 +2,7 @@ import { updateActivityActionTypes } from '../actions/activity-actions'; import { updateCalendarQueryActionTypes } from '../actions/entry-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { logOutActionTypes, deleteAccountActionTypes, @@ -73,7 +74,10 @@ getConfig().platformDetails.platform, ), }; - } else if (action.type === logInActionTypes.success) { + } else if ( + action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success + ) { return { ...state, actualizedCalendarQuery: action.payload.calendarResult.calendarQuery, diff --git a/lib/reducers/data-loaded-reducer.js b/lib/reducers/data-loaded-reducer.js --- a/lib/reducers/data-loaded-reducer.js +++ b/lib/reducers/data-loaded-reducer.js @@ -1,5 +1,6 @@ // @flow +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { logOutActionTypes, deleteAccountActionTypes, @@ -15,6 +16,7 @@ ): boolean { if ( action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success ) { return true; diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js --- a/lib/reducers/entry-reducer.js +++ b/lib/reducers/entry-reducer.js @@ -24,6 +24,7 @@ fetchRevisionsForEntryActionTypes, restoreEntryActionTypes, } from '../actions/entry-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { deleteThreadActionTypes, leaveThreadActionTypes, @@ -487,7 +488,10 @@ }, [], ]; - } else if (action.type === logInActionTypes.success) { + } else if ( + action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success + ) { const { calendarResult } = action.payload; if (calendarResult) { const [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos( diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js --- a/lib/reducers/master-reducer.js +++ b/lib/reducers/master-reducer.js @@ -1,5 +1,6 @@ // @flow +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { registerActionTypes, logInActionTypes } from '../actions/user-actions'; import type { BaseNavInfo } from '../types/nav-types'; import type { BaseAppState, BaseAction } from '../types/redux-types'; @@ -64,7 +65,8 @@ action.type !== incrementalStateSyncActionType && action.type !== fullStateSyncActionType && action.type !== registerActionTypes.success && - action.type !== logInActionTypes.success + action.type !== logInActionTypes.success && + action.type !== siweAuthActionTypes.success ) { if (messageStore.currentAsOf !== state.messageStore.currentAsOf) { messageStore = { diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -34,6 +34,7 @@ fetchSingleMostRecentMessagesFromThreadsActionTypes, } from '../actions/message-actions'; import { sendMessageReportActionTypes } from '../actions/message-report-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { changeThreadSettingsActionTypes, deleteThreadActionTypes, @@ -689,7 +690,10 @@ action: BaseAction, newThreadInfos: { +[id: string]: RawThreadInfo }, ): ReduceMessageStoreResult { - if (action.type === logInActionTypes.success) { + if ( + action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success + ) { const messagesResult = action.payload.messagesResult; const { messageStoreOperations, diff --git a/lib/reducers/nav-reducer.js b/lib/reducers/nav-reducer.js --- a/lib/reducers/nav-reducer.js +++ b/lib/reducers/nav-reducer.js @@ -1,6 +1,7 @@ // @flow import { updateCalendarQueryActionTypes } from '../actions/entry-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { logInActionTypes, registerActionTypes } from '../actions/user-actions'; import type { BaseNavInfo } from '../types/nav-types'; import type { BaseAction } from '../types/redux-types'; @@ -15,6 +16,7 @@ ): T { if ( action.type === logInActionTypes.started || + action.type === siweAuthActionTypes.started || action.type === registerActionTypes.started || action.type === fullStateSyncActionType || action.type === incrementalStateSyncActionType diff --git a/lib/reducers/report-store-reducer.js b/lib/reducers/report-store-reducer.js --- a/lib/reducers/report-store-reducer.js +++ b/lib/reducers/report-store-reducer.js @@ -5,6 +5,7 @@ sendReportsActionTypes, queueReportsActionType, } from '../actions/report-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { logOutActionTypes, deleteAccountActionTypes, @@ -55,7 +56,10 @@ queuedReports: [], enabledReports: isDev ? defaultDevEnabledReports : defaultEnabledReports, }; - } else if (action.type === logInActionTypes.success) { + } else if ( + action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success + ) { return { queuedReports: [], enabledReports: diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -8,6 +8,7 @@ } from '../actions/activity-actions'; import { setClientDBStoreActionType } from '../actions/client-db-store-actions.js'; import { saveMessagesActionType } from '../actions/message-actions'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { changeThreadSettingsActionTypes, deleteThreadActionTypes, @@ -158,6 +159,7 @@ } { if ( action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success || action.type === fullStateSyncActionType ) { diff --git a/lib/reducers/updates-reducer.js b/lib/reducers/updates-reducer.js --- a/lib/reducers/updates-reducer.js +++ b/lib/reducers/updates-reducer.js @@ -1,5 +1,6 @@ // @flow +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { logInActionTypes } from '../actions/user-actions'; import type { BaseAction } from '../types/redux-types'; import { @@ -12,7 +13,10 @@ currentAsOf: number, action: BaseAction, ): number { - if (action.type === logInActionTypes.success) { + if ( + action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success + ) { return action.payload.updatesCurrentAsOf; } else if (action.type === fullStateSyncActionType) { return action.payload.updatesCurrentAsOf; diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -3,6 +3,7 @@ import _isEqual from 'lodash/fp/isEqual'; import _keyBy from 'lodash/fp/keyBy'; +import { siweAuthActionTypes } from '../actions/siwe-actions'; import { joinThreadActionTypes, newThreadActionTypes, @@ -44,6 +45,7 @@ ): ?CurrentUserInfo { if ( action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success || action.type === logOutActionTypes.success || action.type === deleteAccountActionTypes.success @@ -153,6 +155,7 @@ }; } else if ( action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success || action.type === fullStateSyncActionType ) { diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -896,7 +896,7 @@ } | { +type: 'SIWE_AUTH_STARTED', - +payload?: void, + +payload: LogInStartingPayload, +loadingInfo: LoadingInfo, } | { diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -9,6 +9,7 @@ import { setClientDBStoreActionType } from 'lib/actions/client-db-store-actions'; import { setDeviceTokenActionTypes } from 'lib/actions/device-actions'; +import { siweAuthActionTypes } from 'lib/actions/siwe-actions'; import { logOutActionTypes, deleteAccountActionTypes, @@ -215,7 +216,8 @@ action.payload.sessionChange.currentUserInfo, action.payload.logInActionSource, )) || - (action.type === logInActionTypes.success && + ((action.type === logInActionTypes.success || + action.type === siweAuthActionTypes.success) && invalidSessionRecovery( state, action.payload.currentUserInfo,