mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -50,21 +50,21 @@ class MemberDynamicsController
|
||||
|
||||
Future<void> onRemove(dynamic dynamicId) async {
|
||||
var res = await MsgHttp.removeDynamic(dynIdStr: dynamicId);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeWhere((item) => item.idStr == dynamicId)
|
||||
..refresh();
|
||||
SmartDialog.showToast('删除成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSetTop(bool isTop, dynamic dynamicId) async {
|
||||
var res = isTop
|
||||
? await DynamicsHttp.rmTop(dynamicId: dynamicId)
|
||||
: await DynamicsHttp.setTop(dynamicId: dynamicId);
|
||||
if (res['status']) {
|
||||
Future<void> onSetTop(bool isTop, Object dynamicId) async {
|
||||
var res = await (isTop
|
||||
? DynamicsHttp.rmTop(dynamicId: dynamicId)
|
||||
: DynamicsHttp.setTop(dynamicId: dynamicId));
|
||||
if (res.isSuccess) {
|
||||
List<DynamicItemModel> list = loadingState.value.data!;
|
||||
list[0].modules.moduleTag = null;
|
||||
if (isTop) {
|
||||
@@ -80,7 +80,7 @@ class MemberDynamicsController
|
||||
SmartDialog.showToast('置顶成功');
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user