This commit is contained in:
thororen1234 2024-06-01 14:32:22 -04:00
parent 268e053d68
commit 7da91d94d8
77 changed files with 3175 additions and 1964 deletions

View file

@ -128,17 +128,6 @@ export default new (class NoteHandler {
});
};
public deleteEverything = async () => {
noteHandlerCache.clear();
await DeleteEntireStore();
Toasts.show({
id: Toasts.genId(),
message: "Successfully deleted all notes.",
type: Toasts.Type.SUCCESS,
});
};
public deleteNotebook = async (notebookName: string) => {
noteHandlerCache.delete(notebookName);
deleteCacheFromDataStore(notebookName);
@ -182,6 +171,17 @@ export default new (class NoteHandler {
};
public deleteEverything = async () => {
noteHandlerCache.clear();
await DeleteEntireStore();
Toasts.show({
id: Toasts.genId(),
message: "Successfully deleted all notes.",
type: Toasts.Type.SUCCESS,
});
};
public exportNotes = async () => {
return this.getAllNotes();
};

View file

@ -8,7 +8,7 @@ import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, M
import { findByProps } from "@webpack";
import { Button, Forms, Text } from "@webpack/common";
import noteHandler from "../../NoteHandler";
import noteHandler from "../../noteHandler";
import { downloadNotes, uploadNotes } from "../../utils";
export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void; }) => {

View file

@ -10,7 +10,7 @@ import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, M
import { findByProps } from "@webpack";
import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, Text, TextInput } from "@webpack/common";
import noteHandler from "../../NoteHandler";
import noteHandler from "../../noteHandler";
import { HolyNotes } from "../../types";
import HelpIcon from "../icons/HelpIcon";
import Errors from "./Error";

View file

@ -7,7 +7,7 @@
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
import { Button, React, Text, TextInput } from "@webpack/common";
import noteHandler from "../../NoteHandler";
import noteHandler from "../../noteHandler";
export default (props: ModalProps & { onClose: () => void; }) => {
const [notebookName, setNotebookName] = React.useState("");

View file

@ -8,7 +8,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal";
import { Button, React, Text } from "@webpack/common";
import noteHandler from "../../NoteHandler";
import noteHandler from "../../noteHandler";
import Error from "./Error";
import { RenderMessage } from "./RenderMessage";

View file

@ -9,7 +9,7 @@ import { ModalProps } from "@utils/modal";
import { findByCode, findByProps } from "@webpack";
import { Clipboard, ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common";
import noteHandler from "../../NoteHandler";
import noteHandler from "../../noteHandler";
import { HolyNotes } from "../../types";

View file

@ -22,7 +22,6 @@ import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { DataStore } from "@api/index";
import { addButton, removeButton } from "@api/MessagePopover";
import ErrorBoundary from "@components/ErrorBoundary";
import { EquicordDevs } from "@utils/constants";
import { classes } from "@utils/misc";
import { openModal } from "@utils/modal";
import definePlugin from "@utils/types";
@ -32,7 +31,7 @@ import { Message } from "discord-types/general";
import { Popover as NoteButtonPopover, Popover } from "./components/icons/NoteButton";
import { NoteModal } from "./components/modals/Notebook";
import noteHandler, { noteHandlerCache } from "./NoteHandler";
import noteHandler, { noteHandlerCache } from "./noteHandler";
import { DataStoreToCache, HolyNoteStore } from "./utils";
const HeaderBarIcon = findExportedComponentLazy("Icon", "Divider");
@ -71,7 +70,7 @@ function ToolBarHeader() {
export default definePlugin({
name: "HolyNotes",
description: "Holy Notes allows you to save messages",
authors: [EquicordDevs.Wolfie],
authors: [{ id: 347096063569559553n, name: "wolfieeeeeeee" }],
dependencies: ["MessagePopoverAPI", "ChatInputButtonAPI"],
patches: [
@ -129,4 +128,3 @@ export default definePlugin({
removeButton("HolyNotes");
}
});

View file

@ -8,7 +8,7 @@ import { createStore } from "@api/DataStore";
import { DataStore } from "@api/index";
import { Toasts } from "@webpack/common";
import noteHandler, { noteHandlerCache } from "./NoteHandler";
import noteHandler, { noteHandlerCache } from "./noteHandler";
import { HolyNotes } from "./types";
export const HolyNoteStore = createStore("HolyNoteData", "HolyNoteStore");