[UI > Settings] Fix alert race condition (#162)
This commit is contained in:
parent
8352072654
commit
43d351ce4f
1 changed files with 3 additions and 3 deletions
|
@ -49,16 +49,16 @@ export const getScreens = (youKeys = false): Screen[] => [
|
||||||
alertTitle="Install Plugin"
|
alertTitle="Install Plugin"
|
||||||
installFunction={async (input) => {
|
installFunction={async (input) => {
|
||||||
if (!input.startsWith(PROXY_PREFIX) && !settings.developerSettings)
|
if (!input.startsWith(PROXY_PREFIX) && !settings.developerSettings)
|
||||||
showConfirmationAlert({
|
setImmediate(() => showConfirmationAlert({
|
||||||
title: "Unproxied Plugin",
|
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?",
|
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",
|
confirmText: "Install",
|
||||||
onConfirm: () =>
|
onConfirm: () =>
|
||||||
installPlugin(input)
|
installPlugin(input)
|
||||||
.then(() => showToast("Installed plugin", getAssetIDByName("Check")))
|
.then(() => showToast("Installed plugin", getAssetIDByName("Check")))
|
||||||
.catch((x) => showToast(x.toString(), getAssetIDByName("Small"))),
|
.catch((x) => showToast(x?.message ?? `${x}`, getAssetIDByName("Small"))),
|
||||||
cancelText: "Cancel",
|
cancelText: "Cancel",
|
||||||
});
|
}));
|
||||||
else return await installPlugin(input);
|
else return await installPlugin(input);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue