From 4a4aa569ecec62f3f53e16c0f699b1584380ce7e Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 11 Aug 2025 14:06:33 +0800 Subject: [PATCH] check reply state Closes #990 Signed-off-by: bggRGjQaUbCoE --- lib/http/search.dart | 4 ++-- lib/pages/common/reply_controller.dart | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/http/search.dart b/lib/http/search.dart index 3b580c681..9e2c6ee0c 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -99,8 +99,8 @@ class SearchHttp { case SearchType.article: data = SearchArticleData.fromJson(res.data['data']); break; - default: - break; + // default: + // break; } return Success(data); } catch (err) { diff --git a/lib/pages/common/reply_controller.dart b/lib/pages/common/reply_controller.dart index c959f13ac..b2c814be1 100644 --- a/lib/pages/common/reply_controller.dart +++ b/lib/pages/common/reply_controller.dart @@ -111,6 +111,12 @@ abstract class ReplyController extends CommonListController { ReplyInfo? replyItem, int? replyType, }) { + if (loadingState.value case Error error) { + if (error.errMsg?.contains('关闭评论区') == true) { + SmartDialog.showToast(error.errMsg!); + return; + } + } assert(replyItem != null || (oid != null && replyType != null)); String? hint; try {