diff --git a/src/plugins/holynotes/components/modals/Notebook.tsx b/src/plugins/holynotes/components/modals/Notebook.tsx index 5db29a5ed..2dae430cc 100644 --- a/src/plugins/holynotes/components/modals/Notebook.tsx +++ b/src/plugins/holynotes/components/modals/Notebook.tsx @@ -69,6 +69,7 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => { const notes = noteHandler.getNotes(currentNotebook); if (!notes) return <>; + const { TabBar, selectedTab } = CreateTabBar({ tabs: noteHandler.getAllNotes(), firstSelectedTab: currentNotebook, onChangeTab: setCurrentNotebook }); return ( diff --git a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx index 261bda316..30acda07b 100644 --- a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx +++ b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx @@ -5,7 +5,7 @@ */ import ErrorBoundary from "@components/ErrorBoundary"; -import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps,ModalRoot, ModalSize } from "@utils/modal"; +import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal"; import { Button, React, Text } from "@webpack/common"; import noteHandler from "plugins/holynotes/noteHandler"; @@ -15,7 +15,10 @@ import { RenderMessage } from "./RenderMessage"; export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => { const notes = noteHandler.getNotes(notebook); - if (!notes) return <>; + const handleDelete = () => { + onClose(); + noteHandler.deleteNotebook(notebook); + }; return ( v - {Object.keys(notes).length === 0 || !notes ? ( - - ) : ( + {notes && Object.keys(notes).length > 0 ? ( Object.values(notes).map(note => ( )) + ) : ( + )}