fix app delete bug

This commit is contained in:
DASHU
2024-10-10 09:00:45 +08:00
parent 3facd2842c
commit 44ed45bdd8
3 changed files with 4 additions and 3 deletions

View File

@@ -37,6 +37,6 @@ class AppDB {
static Future<void> delete(int id, {DatabaseExecutor? db}) async {
db = await DB.getDB(db);
db.execute("delete from app where id = ?");
db.execute("delete from app where id = ?", [id]);
}
}

View File

@@ -121,7 +121,6 @@ class AppProvider extends ChangeNotifier {
Future<void> deleteApp(App app) async {
await AppDB.delete(app.id!);
reload();
try {
await AuthLogDB.deleteByAppId(app.id!);
@@ -129,7 +128,7 @@ class AppProvider extends ChangeNotifier {
print(e.toString());
}
notifyListeners();
reload();
}
App? getAppById(int appId) {

View File

@@ -83,6 +83,8 @@ class _AppsRouter extends CustState<AppsRouter> {
try {
appProvider.deleteApp(app);
} catch (e) {
print("delete app error");
print(e);
} finally {
cancelFunc.call();
}