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

@@ -36,9 +36,11 @@ class HistoryBaseController extends GetxController {
SmartDialog.showLoading(msg: '请求中');
var res = await UserHttp.clearHistory(account: account);
SmartDialog.dismiss();
if (res.data['code'] == 0) {
if (res.isSuccess) {
SmartDialog.showToast('清空观看历史');
onSuccess();
} else {
res.toast();
}
},
child: const Text('确认清空'),
@@ -74,13 +76,15 @@ class HistoryBaseController extends GetxController {
account: account,
);
SmartDialog.dismiss();
if (res.data['code'] == 0) {
if (res.isSuccess) {
SmartDialog.showToast(pauseStatus ? '暂停观看历史' : '恢复观看历史');
this.pauseStatus.value = pauseStatus;
GStorage.localCache.put(
LocalCacheKey.historyPause,
pauseStatus,
);
} else {
res.toast();
}
Get.back();
},