From 4f45b14059e5b309f4a98eeedb85672ab3181173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicole=20Miko=C5=82ajczyk?= Date: Sat, 12 Apr 2025 22:38:58 +0200 Subject: [PATCH] pl-fe: reset to default state when clearing compose form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicole Mikołajczyk --- packages/pl-fe/src/reducers/compose.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/pl-fe/src/reducers/compose.ts b/packages/pl-fe/src/reducers/compose.ts index 1f47fef8f..ba93db7bb 100644 --- a/packages/pl-fe/src/reducers/compose.ts +++ b/packages/pl-fe/src/reducers/compose.ts @@ -441,14 +441,15 @@ const compose = (state = initialState, action: ComposeAction | EventsAction | In case COMPOSE_RESET: case COMPOSE_SUBMIT_SUCCESS: return create(state, (draft) => { - draft[action.composeId] = newCompose({ + draft[action.composeId] = create(state.default, (draft) => ({ + ...draft, idempotencyKey: crypto.randomUUID(), in_reply_to: action.composeId.startsWith('reply:') ? action.composeId.slice(6) : null, ...(action.composeId.startsWith('group:') ? { privacy: 'group', group_id: action.composeId.slice(6), } : undefined), - }); + })); }); case COMPOSE_SUBMIT_FAIL: return updateCompose(state, action.composeId, compose => {