From 60961575077e0fcc90e1f2c7c2dacfe8fb5f3198 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Wed, 3 Jan 2024 22:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20=E4=BF=AE=E5=A4=8D=20qodana=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/Sqlite/index.ts | 14 ++++++++------ src/utils/TGClient.ts | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) 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;