mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-17 09:54: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 {
|
static Future<void> delete(int id, {DatabaseExecutor? db}) async {
|
||||||
db = await DB.getDB(db);
|
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 {
|
Future<void> deleteApp(App app) async {
|
||||||
await AppDB.delete(app.id!);
|
await AppDB.delete(app.id!);
|
||||||
reload();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AuthLogDB.deleteByAppId(app.id!);
|
await AuthLogDB.deleteByAppId(app.id!);
|
||||||
@@ -129,7 +128,7 @@ class AppProvider extends ChangeNotifier {
|
|||||||
print(e.toString());
|
print(e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyListeners();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
App? getAppById(int appId) {
|
App? getAppById(int appId) {
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ class _AppsRouter extends CustState<AppsRouter> {
|
|||||||
try {
|
try {
|
||||||
appProvider.deleteApp(app);
|
appProvider.deleteApp(app);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
print("delete app error");
|
||||||
|
print(e);
|
||||||
} finally {
|
} finally {
|
||||||
cancelFunc.call();
|
cancelFunc.call();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user