feat(errors): better download manager errors + modal

This commit is contained in:
DecDuck
2024-12-26 12:56:54 +11:00
parent 85a08990c3
commit ad92dbec08
5 changed files with 31 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import { listen } from "@tauri-apps/api/event";
import { data } from "autoprefixer";
import { AppStatus, type AppState } from "~/types";
export function setupHooks() {
@ -18,6 +19,20 @@ export function setupHooks() {
router.push("/store");
});
listen("download_error", (event) => {
createModal(
ModalType.Notification,
{
title: "Drop encountered an error while downloading",
description: `Drop encountered an error while downloading your game: "${(
event.payload as unknown as string
).toString()}"`,
buttonText: "Close"
},
(e, c) => c()
);
});
/*
document.addEventListener("contextmenu", (event) => {