From bae721c49eb85b590fde3b2d1158f79086d44c9f Mon Sep 17 00:00:00 2001 From: ttyS3 Date: Sat, 12 Mar 2022 03:00:46 +0800 Subject: [PATCH] chore: show open app and log dir failed message --- src/services/cmds.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/services/cmds.ts b/src/services/cmds.ts index a3b59f5..694b854 100644 --- a/src/services/cmds.ts +++ b/src/services/cmds.ts @@ -1,5 +1,6 @@ import { invoke } from "@tauri-apps/api/tauri"; import { ApiType, CmdType } from "./types"; +import Notice from "../components/base/base-notice"; export async function getProfiles() { return invoke("get_profiles"); @@ -83,9 +84,13 @@ export async function killSidecars() { } export async function openAppDir() { - return invoke("open_app_dir"); + return invoke("open_app_dir") + .then((message) => console.log(message)) + .catch((err) => Notice.error(err?.message || err.toString(), 1500)); } export async function openLogsDir() { - return invoke("open_logs_dir"); + return invoke("open_logs_dir") + .then((message) => console.log(message)) + .catch((err) => Notice.error(err?.message || err.toString(), 1500)); }