diff --git a/src/plugins/Sqlite/index.ts b/src/plugins/Sqlite/index.ts index 9dc4af04..9f4ec82e 100644 --- a/src/plugins/Sqlite/index.ts +++ b/src/plugins/Sqlite/index.ts @@ -1,7 +1,7 @@ /** * @file plugins/Sqlite/index.ts * @description Sqlite 数据库操作类 - * @since Beta v0.3.9 + * @since Beta v0.4.0 */ import { app } from "@tauri-apps/api"; @@ -186,15 +186,17 @@ class Sqlite { /** * @description 重置数据库 - * @since Beta v0.3.3 + * @since Beta v0.4.0 * @returns {Promise} */ public async reset(): Promise { const db = await this.getDB(); - this.tables.map(async (item) => { - const sql = `DROP TABLE IF EXISTS ${item};`; - await db.execute(sql); - }); + await Promise.all( + this.tables.map(async (item) => { + const sql = `DROP TABLE IF EXISTS ${item};`; + await db.execute(sql); + }), + ); await this.initDB(); } diff --git a/src/utils/TGClient.ts b/src/utils/TGClient.ts index 34e856a4..b93eb148 100644 --- a/src/utils/TGClient.ts +++ b/src/utils/TGClient.ts @@ -173,7 +173,7 @@ class TGClient { * @returns {Promise} - 返回值 */ async handleCallback(arg: Event): Promise { - const argParse: TGApp.Plugins.JSBridge.Arg = JSON.parse(arg.payload); + const argParse: TGApp.Plugins.JSBridge.Arg = JSON.parse(arg.payload); if (argParse.method.startsWith("teyvat")) { await this.handleCustomCallback(argParse); return;