From 3a535db8722aeebeaffadb17af0c79e791bc3fbd Mon Sep 17 00:00:00 2001 From: Wolfie <32025746+Wolfkid200444@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:06:03 -0400 Subject: [PATCH] Fix notebook delete modal --- .../holynotes/components/modals/ManageNotebookButton.tsx | 4 ++-- .../holynotes/components/modals/NotebookDeleteModal.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/holynotes/components/modals/ManageNotebookButton.tsx b/src/plugins/holynotes/components/modals/ManageNotebookButton.tsx index bc1fe3860..7e30793c6 100644 --- a/src/plugins/holynotes/components/modals/ManageNotebookButton.tsx +++ b/src/plugins/holynotes/components/modals/ManageNotebookButton.tsx @@ -10,7 +10,7 @@ import { Button, React } from "@webpack/common"; import NotebookCreateModal from "./NotebookCreateModal"; import NotebookDeleteModal from "./NotebookDeleteModal"; -export default ({ notebook }: { notebook: string, setNotebook: React.Dispatch>; }) => { +export default ({ notebook, setNotebook }: { notebook: string, setNotebook: React.Dispatch>; }) => { const isNotMain = notebook !== "Main"; return ( @@ -18,7 +18,7 @@ export default ({ notebook }: { notebook: string, setNotebook: React.Dispatch openModal(props => ) + ? () => openModal(props => ) : () => openModal(props => ) } > diff --git a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx index 30acda07b..862795e31 100644 --- a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx +++ b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx @@ -12,11 +12,12 @@ import noteHandler from "plugins/holynotes/noteHandler"; import Error from "./Error"; import { RenderMessage } from "./RenderMessage"; -export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => { +export default ({ onClose, notebook, onChangeTab, ...props }: ModalProps & { onClose: () => void; notebook: string; onChangeTab: React.Dispatch>; }) => { const notes = noteHandler.getNotes(notebook); const handleDelete = () => { onClose(); + onChangeTab("Main"); noteHandler.deleteNotebook(notebook); };