refactor: Optimize implementation of Custom tray icon

This commit is contained in:
MystiPanda
2024-02-24 11:25:22 +08:00
parent 6f546a424e
commit c2852c8a82
9 changed files with 111 additions and 46 deletions

View File

@@ -139,6 +139,10 @@ export async function grantPermission(core: string) {
return invoke<void>("grant_permission", { core });
}
export async function getAppDir() {
return invoke<string>("get_app_dir");
}
export async function openAppDir() {
return invoke<void>("open_app_dir").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
@@ -212,3 +216,10 @@ export async function getPortableFlag() {
export async function exitApp() {
return invoke("exit_app");
}
export async function copyIconFile(
path: string,
name: "common.png" | "sysproxy.png" | "tun.png"
) {
return invoke<void>("copy_icon_file", { path, name });
}