fix: close editor on discarding new post

This commit is contained in:
hugo committed 2026-02-14 08:27:20 +01:00
1 parent 155e7a09d2
commit 965dc6c3c5
1 file changed
+1 -1
+1 -1
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) {