From 3db2a13ad99c66ff1cb775eda012a4691d1acce3 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Wed, 4 Dec 2024 22:57:03 +0100 Subject: [PATCH] pl-fe: fix main compose gets filled with irrelevant content Signed-off-by: mkljczk --- packages/pl-fe/src/reducers/compose.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/pl-fe/src/reducers/compose.ts b/packages/pl-fe/src/reducers/compose.ts index effcc87a6..09afb0935 100644 --- a/packages/pl-fe/src/reducers/compose.ts +++ b/packages/pl-fe/src/reducers/compose.ts @@ -306,7 +306,9 @@ const updateDefaultContentType = (compose: Compose, instance: Instance) => { const updateCompose = (state: State, key: string, updater: (compose: Compose) => void) => create(state, draft => { - draft[key] = draft[key] || create(draft.default, () => {}); + draft[key] = draft[key] || create(draft.default, (draft) => { + draft.idempotencyKey = crypto.randomUUID(); + }); updater(draft[key]); }); // state.update(key, state.get('default')!, updater); @@ -616,8 +618,8 @@ const compose = (state = initialState, action: ComposeAction | EventsAction | In case ME_FETCH_SUCCESS: case ME_PATCH_SUCCESS: return updateCompose(state, 'default', compose => importAccount(compose, action.me)); - // case SETTING_CHANGE: - // return updateCompose(state, 'default', compose => updateSetting(compose, action.path, action.value)); + // case SETTING_CHANGE: + // return updateCompose(state, 'default', compose => updateSetting(compose, action.path, action.value)); case COMPOSE_EDITOR_STATE_SET: return updateCompose(state, action.composeId, compose => { if (!compose.modified_language || compose.modified_language === compose.language) {