Changeset View
Changeset View
Standalone View
Standalone View
web/redux/redux-setup.js
Show All 12 Lines | |||||
import { | import { | ||||
type ReplaceKeyserverOperation, | type ReplaceKeyserverOperation, | ||||
keyserverStoreOpsHandlers, | keyserverStoreOpsHandlers, | ||||
} from 'lib/ops/keyserver-store-ops.js'; | } from 'lib/ops/keyserver-store-ops.js'; | ||||
import { | import { | ||||
type ThreadStoreOperation, | type ThreadStoreOperation, | ||||
threadStoreOpsHandlers, | threadStoreOpsHandlers, | ||||
} from 'lib/ops/thread-store-ops.js'; | } from 'lib/ops/thread-store-ops.js'; | ||||
import { queueDBOps } from 'lib/reducers/db-ops-reducer.js'; | |||||
import { reduceLoadingStatuses } from 'lib/reducers/loading-reducer.js'; | import { reduceLoadingStatuses } from 'lib/reducers/loading-reducer.js'; | ||||
import baseReducer from 'lib/reducers/master-reducer.js'; | import baseReducer from 'lib/reducers/master-reducer.js'; | ||||
import { mostRecentlyReadThreadSelector } from 'lib/selectors/thread-selectors.js'; | import { mostRecentlyReadThreadSelector } from 'lib/selectors/thread-selectors.js'; | ||||
import { isLoggedIn } from 'lib/selectors/user-selectors.js'; | import { isLoggedIn } from 'lib/selectors/user-selectors.js'; | ||||
import { | import { | ||||
invalidSessionDowngrade, | invalidSessionDowngrade, | ||||
identityInvalidSessionDowngrade, | identityInvalidSessionDowngrade, | ||||
} from 'lib/shared/session-utils.js'; | } from 'lib/shared/session-utils.js'; | ||||
▲ Show 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | ): AppState { | ||||
// The operations were already dispatched from the main tab | // The operations were already dispatched from the main tab | ||||
// For now the `dispatchSource` field is not included in any of the | // For now the `dispatchSource` field is not included in any of the | ||||
// redux actions and this causes flow to throw an error. | // redux actions and this causes flow to throw an error. | ||||
// As soon as one of the actions is updated, this fix (and the corresponding | // As soon as one of the actions is updated, this fix (and the corresponding | ||||
// one in tab-synchronization.js) can be removed. | // one in tab-synchronization.js) can be removed. | ||||
// $FlowFixMe | // $FlowFixMe | ||||
if (action.dispatchSource !== 'tab-sync') { | if (action.dispatchSource !== 'tab-sync') { | ||||
state = { | |||||
...state, | |||||
dbOpsStore: queueDBOps( | |||||
state.dbOpsStore, | |||||
action.messageID, | |||||
storeOperations, | |||||
), | |||||
}; | |||||
void processDBStoreOperations( | void processDBStoreOperations( | ||||
storeOperations, | storeOperations, | ||||
state.currentUserInfo?.id ?? null, | state.currentUserInfo?.id ?? null, | ||||
); | ); | ||||
} | } | ||||
return state; | return state; | ||||
} | } | ||||
export { nonUserSpecificFieldsWeb, reducer }; | export { nonUserSpecificFieldsWeb, reducer }; |