diff --git a/src/store/store.tsx b/src/store/store.tsx index f62f433117..232a0bc8e5 100644 --- a/src/store/store.tsx +++ b/src/store/store.tsx @@ -22,6 +22,7 @@ import { inboxTransform, lastCommonFromFeedTransform, cacheTransform, + multipleSpacesLayoutTransform, } from "./transforms"; const persistConfig: PersistConfig = { @@ -37,7 +38,12 @@ const persistConfig: PersistConfig = { "multipleSpacesLayout", ], stateReconciler: autoMergeLevel2, - transforms: [inboxTransform, lastCommonFromFeedTransform, cacheTransform], + transforms: [ + inboxTransform, + lastCommonFromFeedTransform, + cacheTransform, + multipleSpacesLayoutTransform, + ], }; const sagaMiddleware = createSagaMiddleware(); diff --git a/src/store/transforms.ts b/src/store/transforms.ts index 625133dfc4..5298dead99 100644 --- a/src/store/transforms.ts +++ b/src/store/transforms.ts @@ -2,14 +2,15 @@ import { createTransform } from "redux-persist"; import { deserializeFeedLayoutItemWithFollowData } from "@/shared/interfaces"; import { convertObjectDatesToFirestoreTimestamps } from "@/shared/utils"; import { getFeedLayoutItemDateForSorting } from "@/store/states/inbox/utils"; -import { CommonLayoutState } from "./states/commonLayout"; import { CacheState } from "./states/cache"; +import { CommonLayoutState } from "./states/commonLayout"; import { InboxItems, InboxState, INITIAL_INBOX_ITEMS, INITIAL_INBOX_STATE, } from "./states/inbox"; +import { MultipleSpacesLayoutState } from "./states/multipleSpacesLayout"; export const inboxTransform = createTransform( (inboundState: InboxState) => { @@ -89,7 +90,17 @@ export const cacheTransform = createTransform( (inboundState: CacheState) => inboundState, (outboundState: CacheState) => ({ ...outboundState, - discussionMessagesStates: {} + discussionMessagesStates: {}, }), { whitelist: ["cache"] }, ); + +export const multipleSpacesLayoutTransform = createTransform( + (inboundState: MultipleSpacesLayoutState) => ({ + ...inboundState, + breadcrumbs: null, + backUrl: null, + }), + (outboundState: MultipleSpacesLayoutState) => outboundState, + { whitelist: ["multipleSpacesLayout"] }, +);