feat: new error banner, qol

This commit is contained in:
2025-04-04 22:14:09 +00:00
parent ca871f069f
commit 93e0a7e313
7 changed files with 112 additions and 26 deletions

View File

@ -3,7 +3,7 @@ import {
InvokeOptions,
invoke as real_invoke,
} from '@tauri-apps/api/core';
import { message } from '@tauri-apps/plugin-dialog';
import { emit } from '@tauri-apps/api/event';
export const invoke = async <T>(
cmd: string,
@ -14,9 +14,9 @@ export const invoke = async <T>(
return await real_invoke(cmd, args, options);
} catch (e: unknown) {
if (typeof e === 'string') {
await message(`${cmd}: ${e}`, {
title: `Error`,
kind: 'error',
emit('invoke-error', {
message: e,
header: `${cmd} failed`,
});
} else {
console.error(`Unresolved error: ${e}`);