fix: delete tab on delete of published post
This commit is contained in:
@@ -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);
|
||||
}) || (() => {})
|
||||
);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user