diff --git a/web/redux/initial-state-gate.js b/web/redux/initial-state-gate.js --- a/web/redux/initial-state-gate.js +++ b/web/redux/initial-state-gate.js @@ -5,6 +5,7 @@ import type { Persistor } from 'redux-persist/es/types'; import { setClientDBStoreActionType } from 'lib/actions/client-db-store-actions.js'; +import type { EntryStoreOperation } from 'lib/ops/entries-store-ops.js'; import type { MessageStoreOperation } from 'lib/ops/message-store-ops.js'; import type { ThreadStoreOperation } from 'lib/ops/thread-store-ops.js'; import type { UserStoreOperation } from 'lib/ops/user-store-ops.js'; @@ -147,10 +148,19 @@ ]; } + const entryStoreOperations: Array = [ + { type: 'remove_all_entries' }, + ...entries(payload.entryStore.entryInfos).map(([id, entry]) => ({ + type: 'replace_entry', + payload: { id, entry }, + })), + ]; + if ( threadStoreOperations.length > 0 || userStoreOperations.length > 0 || - messageStoreOperations.length > 0 + messageStoreOperations.length > 0 || + entryStoreOperations.length > 0 ) { await processDBStoreOperations( { @@ -165,6 +175,7 @@ syncedMetadataStoreOperations: [], auxUserStoreOperations: [], threadActivityStoreOperations: [], + entryStoreOperations, }, currentLoggedInUserID, );