fix: delete tab on delete of published post

This commit is contained in:
2026-02-14 22:56:30 +01:00
parent 58b46c9229
commit fbfe62cbfd
2 changed files with 2 additions and 0 deletions

View File

@@ -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);
}) || (() => {})
);

View File

@@ -994,6 +994,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().closeTab(postId);
useAppStore.getState().setSelectedPost(null);
showToast.success('Post deleted');
} catch (error) {