mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-26 17:26:22 +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";
|
import { RenderMessage } from "./RenderMessage";
|
||||||
|
|
||||||
export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => {
|
export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => {
|
||||||
const [notes, setNotes] = React.useState({});
|
const notes = noteHandler.getNotes(notebook);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
const update = async () => {
|
|
||||||
const notes = await noteHandler.getNotes(notebook);
|
|
||||||
setNotes(notes);
|
|
||||||
};
|
|
||||||
update();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
if (!notes) return <></>;
|
if (!notes) return <></>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue