pl-fe: reset to default state when clearing compose form

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Nicole Mikołajczyk
2025-04-12 22:38:58 +02:00
parent d01c2d8ff0
commit 4f45b14059

View File

@ -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 => {