mirror of
https://github.com/Sqaaakoi/vc-newPluginsManager.git
synced 2025-02-22 16:18:50 -05:00
Prevent crashes when opening the modal
This commit is contained in:
parent
fb6e9c9bef
commit
9e425d2fd1
1 changed files with 4 additions and 3 deletions
|
@ -11,7 +11,7 @@ import { classNameFactory } from "@api/Styles";
|
|||
import { PluginCard } from "@components/PluginSettings";
|
||||
import { ChangeList } from "@utils/ChangeList";
|
||||
import { classes, Margins } from "@utils/index";
|
||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Button, Flex, Forms, React, Text, Tooltip, useMemo } from "@webpack/common";
|
||||
|
@ -20,6 +20,7 @@ import { JSX } from "react";
|
|||
import Plugins from "~plugins";
|
||||
|
||||
import { getNewPlugins, getNewSettings, KnownPluginSettingsMap, writeKnownSettings } from "./knownSettings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
|
||||
const cl = classNameFactory("vc-plugins-");
|
||||
|
||||
|
@ -193,12 +194,12 @@ export async function openNewPluginsModal() {
|
|||
const newSettings = await getNewSettings();
|
||||
if ((newPlugins.size || newSettings.size) && !hasSeen) {
|
||||
hasSeen = true;
|
||||
openModal(modalProps => (
|
||||
const modalKey = openModal(modalProps => <ErrorBoundary noop onError={() => { closeModal(modalKey); }}>
|
||||
<NewPluginsModal
|
||||
modalProps={modalProps}
|
||||
newPlugins={newPlugins}
|
||||
newSettings={newSettings}
|
||||
/>
|
||||
));
|
||||
</ErrorBoundary>);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue