From 43d351ce4f2f2892120cb5d3d3fcefa6f9d24c77 Mon Sep 17 00:00:00 2001 From: nexpid Date: Fri, 20 Oct 2023 18:06:04 +0200 Subject: [PATCH] [UI > Settings] Fix alert race condition (#162) --- src/ui/settings/data.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/settings/data.tsx b/src/ui/settings/data.tsx index 16d376b..8b4940e 100644 --- a/src/ui/settings/data.tsx +++ b/src/ui/settings/data.tsx @@ -49,16 +49,16 @@ export const getScreens = (youKeys = false): Screen[] => [ alertTitle="Install Plugin" installFunction={async (input) => { if (!input.startsWith(PROXY_PREFIX) && !settings.developerSettings) - showConfirmationAlert({ + setImmediate(() => showConfirmationAlert({ title: "Unproxied Plugin", content: "The plugin you are trying to install has not been proxied/verified by Vendetta staff. Are you sure you want to continue?", confirmText: "Install", onConfirm: () => installPlugin(input) .then(() => showToast("Installed plugin", getAssetIDByName("Check"))) - .catch((x) => showToast(x.toString(), getAssetIDByName("Small"))), + .catch((x) => showToast(x?.message ?? `${x}`, getAssetIDByName("Small"))), cancelText: "Cancel", - }); + })); else return await installPlugin(input); }} />