diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 0f2d023..984a2b6 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -126,6 +126,7 @@ const App: React.FC = () => { unsubscribers.push( window.electronAPI?.on('post:deleted', (id: unknown) => { removePost(id as string); + useAppStore.getState().closeTab(id as string); }) || (() => {}) ); diff --git a/src/renderer/components/Editor/Editor.tsx b/src/renderer/components/Editor/Editor.tsx index 630a26c..2ac6cde 100644 --- a/src/renderer/components/Editor/Editor.tsx +++ b/src/renderer/components/Editor/Editor.tsx @@ -994,6 +994,7 @@ const PostEditor: React.FC = ({ postId }) => { // Clear pending ref to prevent auto-save on unmount from resurrecting the post pendingChangesRef.current = null; useAppStore.getState().removePost(postId); + useAppStore.getState().closeTab(postId); useAppStore.getState().setSelectedPost(null); showToast.success('Post deleted'); } catch (error) {