mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 03:15:14 +08:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -25,15 +25,15 @@ class FavArticleController
|
||||
Future<LoadingState<FavArticleData>> customGetData() =>
|
||||
FavHttp.favArticle(page: page);
|
||||
|
||||
Future<void> onRemove(int index, String? id) async {
|
||||
Future<void> onRemove(int index, String id) async {
|
||||
final res = await FavHttp.communityAction(opusId: id, action: 4);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
..refresh();
|
||||
SmartDialog.showToast('已取消收藏');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user