delete remotesigninginfo when app was deleted

This commit is contained in:
DASHU
2025-12-02 12:00:40 +08:00
parent c464c90606
commit dd58921356
2 changed files with 13 additions and 0 deletions

View File

@@ -73,4 +73,9 @@ class RemoteSigningInfoDB {
"remote_signing_info", await _toJsonWithEncrypt(o, encryptKey), "remote_signing_info", await _toJsonWithEncrypt(o, encryptKey),
where: "id = ?", whereArgs: [o.id]); where: "id = ?", whereArgs: [o.id]);
} }
static Future<void> deleteByAppId(int appId, {DatabaseExecutor? db}) async {
db = await DB.getDB(db);
db.execute("delete from remote_signing_info where app_id = ?", [appId]);
}
} }

View File

@@ -122,6 +122,14 @@ class AppProvider extends ChangeNotifier {
Future<void> deleteApp(App app) async { Future<void> deleteApp(App app) async {
await AppDB.delete(app.id!); await AppDB.delete(app.id!);
if (app.appType == AppType.REMOTE) {
try {
RemoteSigningInfoDB.deleteByAppId(app.id!);
} catch (e) {
print(e.toString());
}
}
try { try {
await AuthLogDB.deleteByAppId(app.id!); await AuthLogDB.deleteByAppId(app.id!);
} catch (e) { } catch (e) {