diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2023-03-01 01:26:13 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-01 05:26:13 +0100 |
commit | faa90eccd363b635b84be2162376645d6a83ad55 (patch) | |
tree | 01473b58f52a54c2dc08234a51a20f0069487981 /src/components/handleComponentFailed.ts | |
parent | c91b0df6071639471cd41b481e7188259a3c1159 (diff) | |
download | Vencord-faa90eccd363b635b84be2162376645d6a83ad55.tar.gz Vencord-faa90eccd363b635b84be2162376645d6a83ad55.tar.bz2 Vencord-faa90eccd363b635b84be2162376645d6a83ad55.zip |
feat: Crash Handler (#531)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/components/handleComponentFailed.ts')
-rw-r--r-- | src/components/handleComponentFailed.ts | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/components/handleComponentFailed.ts b/src/components/handleComponentFailed.ts index 020e8ef..43a3ad8 100644 --- a/src/components/handleComponentFailed.ts +++ b/src/components/handleComponentFailed.ts @@ -16,29 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { isOutdated, rebuild, update } from "@utils/updater"; +import { maybePromptToUpdate } from "@utils/updater"; -export async function handleComponentFailed() { - if (isOutdated) { - setImmediate(async () => { - const wantsUpdate = confirm( - "Uh Oh! Failed to render this Page." + - " However, there is an update available that might fix it." + - " Would you like to update and restart now?" - ); - if (wantsUpdate) { - try { - await update(); - await rebuild(); - if (IS_WEB) - location.reload(); - else - DiscordNative.app.relaunch(); - } catch (e) { - console.error(e); - alert("That also failed :( Try updating or reinstalling with the installer!"); - } - } - }); - } +export function handleComponentFailed() { + maybePromptToUpdate( + "Uh Oh! Failed to render this Page." + + " However, there is an update available that might fix it." + + " Would you like to update and restart now?" + ); } |