fix reply hint

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-29 10:17:17 +08:00
parent d4ac9ab79a
commit 4e9fdfbfbd

View File

@@ -28,6 +28,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
Int64? upMid; Int64? upMid;
Int64? cursorNext; Int64? cursorNext;
SubjectControl? subjectControl;
FeedPaginationReply? paginationReply; FeedPaginationReply? paginationReply;
late Rx<Mode> mode = Mode.MAIN_LIST_HOT.obs; late Rx<Mode> mode = Mode.MAIN_LIST_HOT.obs;
late bool hasUpTop = false; late bool hasUpTop = false;
@@ -73,6 +74,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
paginationReply = data.paginationReply; paginationReply = data.paginationReply;
count.value = data.subjectControl.count.toInt(); count.value = data.subjectControl.count.toInt();
if (isRefresh) { if (isRefresh) {
subjectControl = data.subjectControl;
upMid ??= data.subjectControl.upMid; upMid ??= data.subjectControl.upMid;
hasUpTop = data.hasUpTop(); hasUpTop = data.hasUpTop();
if (data.hasUpTop()) { if (data.hasUpTop()) {
@@ -87,6 +89,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
Future<void> onRefresh() { Future<void> onRefresh() {
cursorNext = null; cursorNext = null;
paginationReply = null; paginationReply = null;
subjectControl = null;
return super.onRefresh(); return super.onRefresh();
} }
@@ -118,13 +121,11 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
assert(replyItem != null || (oid != null && replyType != null)); assert(replyItem != null || (oid != null && replyType != null));
String? hint; String? hint;
try { try {
if (loadingState.value is Success) { if (subjectControl != null) {
SubjectControl subjectControl = if (subjectControl!.hasSwitcherType() &&
(loadingState.value as Success).response.subjectControl; subjectControl!.switcherType != 1 &&
if (subjectControl.hasSwitcherType() && subjectControl!.hasRootText()) {
subjectControl.switcherType != 1 && hint = subjectControl!.rootText;
subjectControl.hasRootText()) {
hint = subjectControl.rootText;
} }
} }
} catch (_) {} } catch (_) {}
@@ -224,7 +225,13 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
); );
} }
Future<void> onToggleTop(index, oid, int type, bool isUpTop, int rpid) async { Future<void> onToggleTop(
int index,
oid,
int type,
bool isUpTop,
int rpid,
) async {
final res = await ReplyHttp.replyTop( final res = await ReplyHttp.replyTop(
oid: oid, oid: oid,
type: type, type: type,