1
0
Fork 1
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:
Wolfie 2024-03-10 08:17:16 -04:00
parent caec2ca309
commit 2f086e993b
No known key found for this signature in database
GPG key ID: DE384EE9BF2D909A

View file

@ -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 <></>;