mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-17 01:44:19 +01:00
fix app delete bug
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -83,6 +83,8 @@ class _AppsRouter extends CustState<AppsRouter> {
|
||||
try {
|
||||
appProvider.deleteApp(app);
|
||||
} catch (e) {
|
||||
print("delete app error");
|
||||
print(e);
|
||||
} finally {
|
||||
cancelFunc.call();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user