mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 16:56:23 +00:00
Refactor NotebookDeleteModal component to remove unnecessary useEffect hook
This commit is contained in:
parent
caec2ca309
commit
2f086e993b
1 changed files with 1 additions and 9 deletions
|
@ -13,15 +13,7 @@ import Error from "./Error";
|
|||
import { RenderMessage } from "./RenderMessage";
|
||||
|
||||
export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => {
|
||||
const [notes, setNotes] = React.useState({});
|
||||
|
||||
React.useEffect(() => {
|
||||
const update = async () => {
|
||||
const notes = await noteHandler.getNotes(notebook);
|
||||
setNotes(notes);
|
||||
};
|
||||
update();
|
||||
}, []);
|
||||
const notes = noteHandler.getNotes(notebook);
|
||||
|
||||
if (!notes) return <></>;
|
||||
|
||||
|
|
Loading…
Reference in a new issue