🌱 share 延时 3s 自动退出

This commit is contained in:
BTMuli
2023-11-02 11:47:31 +08:00
parent a474b96280
commit 468db1171e

View File

@@ -179,7 +179,6 @@ class TGClient {
break;
case "getActionTicket":
await this.getActionTicket(payload, callback);
await this.hideSideBar();
break;
case "getHTTPRequestHeaders":
await this.getHTTPRequestHeaders(callback);
@@ -207,6 +206,9 @@ class TGClient {
case "onClickImg":
await this.onClickImg(payload);
break;
case "share":
await this.share(payload, callback);
break;
// getNotificationSettings
default:
console.warn(`[${arg.windowLabel}] ${arg.payload}`);
@@ -399,6 +401,7 @@ class TGClient {
return;
}
await this.open("pushPage", url);
await this.hideSideBar();
}
/**
@@ -463,6 +466,22 @@ class TGClient {
})();`;
await invoke("execute_js", { label: "mhy_client", js: executeJS });
}
/**
* @func share
* @since Beta v0.3.5
* @desc 分享
* @todo 实现图片获取
* @param {unknown} payload - 请求参数
* @param {string} callback - 回调函数名
* @returns {void} - 无返回值
*/
async share(payload: any, callback: string): Promise<void> {
// 延时 3s
setTimeout(async () => {
await this.callback(callback, {});
}, 3000);
}
}
const mhyClient = new TGClient();