fix: close editor on discarding new post

This commit is contained in:
2026-02-14 08:27:20 +01:00
parent 155e7a09d2
commit 965dc6c3c5

View File

@@ -814,7 +814,7 @@ const PostEditor: React.FC<PostEditorProps> = ({ postId }) => {
// Clear pending ref to prevent auto-save on unmount from resurrecting the post
pendingChangesRef.current = null;
useAppStore.getState().removePost(postId);
useAppStore.getState().setSelectedPost(null);
useAppStore.getState().closeTab(postId);
showToast.success('Draft deleted');
}
} catch (error) {