opt: LoadingState (#1776)

This commit is contained in:
My-Responsitories
2025-12-13 12:43:32 +08:00
committed by GitHub
parent 3741fe54ff
commit 17883eb77e
82 changed files with 832 additions and 887 deletions

View File

@@ -100,7 +100,7 @@ class DynTopicController
var res = isFav
? await FavHttp.delFavTopic(topicId)
: await FavHttp.addFavTopic(topicId);
if (res['status']) {
if (res.isSuccess) {
if (isFav) {
topState.value.data!.topicItem!.fav -= 1;
} else {
@@ -108,7 +108,7 @@ class DynTopicController
}
this.isFav.value = !isFav;
} else {
SmartDialog.showToast(res['msg']);
res.toast();
}
}
@@ -119,7 +119,7 @@ class DynTopicController
}
bool isLike = this.isLike.value ?? false;
var res = await FavHttp.likeTopic(topicId, isLike);
if (res['status']) {
if (res.isSuccess) {
if (isLike) {
topState.value.data!.topicItem!.like -= 1;
} else {
@@ -127,7 +127,7 @@ class DynTopicController
}
this.isLike.value = !isLike;
} else {
SmartDialog.showToast(res['msg']);
res.toast();
}
}
}