chore: show open app and log dir failed message

This commit is contained in:
ttyS3 2022-03-12 03:00:46 +08:00
parent 8890051c17
commit bae721c49e
No known key found for this signature in database
GPG Key ID: E684E1B17F6C9EA5

View File

@ -1,5 +1,6 @@
import { invoke } from "@tauri-apps/api/tauri"; import { invoke } from "@tauri-apps/api/tauri";
import { ApiType, CmdType } from "./types"; import { ApiType, CmdType } from "./types";
import Notice from "../components/base/base-notice";
export async function getProfiles() { export async function getProfiles() {
return invoke<CmdType.ProfilesConfig>("get_profiles"); return invoke<CmdType.ProfilesConfig>("get_profiles");
@ -83,9 +84,13 @@ export async function killSidecars() {
} }
export async function openAppDir() { export async function openAppDir() {
return invoke<void>("open_app_dir"); return invoke<void>("open_app_dir")
.then((message) => console.log(message))
.catch((err) => Notice.error(err?.message || err.toString(), 1500));
} }
export async function openLogsDir() { export async function openLogsDir() {
return invoke<void>("open_logs_dir"); return invoke<void>("open_logs_dir")
.then((message) => console.log(message))
.catch((err) => Notice.error(err?.message || err.toString(), 1500));
} }