🚨 修复 qodana 报错

This commit is contained in:
BTMuli
2024-01-03 22:20:50 +08:00
parent 67e7dabdc6
commit 6096157507
2 changed files with 9 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/** /**
* @file plugins/Sqlite/index.ts * @file plugins/Sqlite/index.ts
* @description Sqlite 数据库操作类 * @description Sqlite 数据库操作类
* @since Beta v0.3.9 * @since Beta v0.4.0
*/ */
import { app } from "@tauri-apps/api"; import { app } from "@tauri-apps/api";
@@ -186,15 +186,17 @@ class Sqlite {
/** /**
* @description 重置数据库 * @description 重置数据库
* @since Beta v0.3.3 * @since Beta v0.4.0
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
public async reset(): Promise<void> { public async reset(): Promise<void> {
const db = await this.getDB(); const db = await this.getDB();
this.tables.map(async (item) => { await Promise.all(
const sql = `DROP TABLE IF EXISTS ${item};`; this.tables.map(async (item) => {
await db.execute(sql); const sql = `DROP TABLE IF EXISTS ${item};`;
}); await db.execute(sql);
}),
);
await this.initDB(); await this.initDB();
} }

View File

@@ -173,7 +173,7 @@ class TGClient {
* @returns {Promise<void>} - 返回值 * @returns {Promise<void>} - 返回值
*/ */
async handleCallback(arg: Event<string>): Promise<void> { async handleCallback(arg: Event<string>): Promise<void> {
const argParse: TGApp.Plugins.JSBridge.Arg<any> = JSON.parse(<string>arg.payload); const argParse: TGApp.Plugins.JSBridge.Arg<any> = JSON.parse(arg.payload);
if (argParse.method.startsWith("teyvat")) { if (argParse.method.startsWith("teyvat")) {
await this.handleCustomCallback(argParse); await this.handleCustomCallback(argParse);
return; return;