mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 08:46:25 +00:00
Fix HN after discord update
This commit is contained in:
parent
b29083ff34
commit
08d320b53a
9 changed files with 21 additions and 19 deletions
|
@ -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; }) => {
|
||||
|
@ -62,7 +62,6 @@ export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void;
|
|||
onClick={() => {
|
||||
noteHandler.refreshAvatars();
|
||||
}}>Refresh Avatars</Button>
|
||||
|
||||
<Button
|
||||
look={Button.Looks.FILLED}
|
||||
color={Button.Colors.GREEN}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { classes } from "@utils/misc";
|
||||
import { findByProps } from "@webpack";
|
||||
import { findByCode } from "@webpack";
|
||||
import { Button, Clickable, Menu, Popout, React } from "@webpack/common";
|
||||
|
||||
import { SvgOverFlowIcon } from "../icons/overFlowIcon";
|
||||
|
@ -20,8 +20,11 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
|
|||
const resizeObserverRef = React.useRef<ResizeObserver | null>(null);
|
||||
const [show, setShow] = React.useState(false);
|
||||
|
||||
const { isNotNullish } = findByProps("isNotNullish");
|
||||
const { overflowIcon } = findByProps("overflowIcon");
|
||||
function isNotNullish(value) {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
const { overflowIcon } = findByCode("overflowIcon");
|
||||
|
||||
const handleResize = React.useCallback(() => {
|
||||
if (!tabBarRef.current) return;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
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 }) => {
|
||||
export default (props: ModalProps & { onClose: () => void; }) => {
|
||||
const [notebookName, setNotebookName] = React.useState("");
|
||||
|
||||
const handleCreateNotebook = React.useCallback(() => {
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
import { classes } from "@utils/misc";
|
||||
import { ModalProps } from "@utils/modal";
|
||||
import { findByCode, findByProps } from "@webpack";
|
||||
import { findByCode, findByCodeLazy, findByProps, findComponentByCodeLazy } from "@webpack";
|
||||
import { Clipboard, ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common";
|
||||
|
||||
import noteHandler from "../../noteHandler";
|
||||
import noteHandler from "../../NoteHandler";
|
||||
import { HolyNotes } from "../../types";
|
||||
|
||||
|
||||
|
@ -26,11 +26,14 @@ export const RenderMessage = ({
|
|||
fromDeleteModal: boolean;
|
||||
closeModal?: () => void;
|
||||
}) => {
|
||||
const ChannelMessage = findByProps("ThreadStarterChatMessage").default;
|
||||
// Bad
|
||||
const ChannelMessage = findComponentByCodeLazy("Message must not be a thread");
|
||||
const { message, groupStart, cozyMessage } = findByProps("cozyMessage");
|
||||
const User = findByCode("isClyde(){");
|
||||
const Message = findByCode("isEdited(){");
|
||||
const Channel = findByProps("ChannelRecordBase").ChannelRecordBase;
|
||||
|
||||
// Bad
|
||||
const Channel = findByCodeLazy("computeLurkerPermissionsAllowList");
|
||||
|
||||
const [isHoldingDelete, setHoldingDelete] = React.useState(false);
|
||||
|
||||
|
|
|
@ -32,7 +32,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");
|
||||
|
@ -129,4 +129,3 @@ export default definePlugin({
|
|||
removeButton("HolyNotes");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -144,8 +144,6 @@ export default new (class NoteHandler {
|
|||
|
||||
const User = findByCode("tag", "isClyde");
|
||||
|
||||
|
||||
|
||||
for (const notebook in notebooks)
|
||||
for (const noteId in notebooks[notebook]) {
|
||||
const note = notebooks[notebook][noteId];
|
||||
|
@ -211,4 +209,3 @@ export default new (class NoteHandler {
|
|||
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
@ -28,6 +28,7 @@ export async function getFormatedEntries() {
|
|||
data.forEach(function (note) {
|
||||
notebooks[note[0].toString()] = note[1];
|
||||
});
|
||||
|
||||
return notebooks;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue