Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-05 12:26:06 +08:00
parent ca387787b3
commit cfa925549e
2 changed files with 23 additions and 12 deletions

View File

@@ -54,11 +54,12 @@ abstract final class ReplyGrpc {
oid: Int64(oid),
type: Int64(type),
rpid: Int64.ZERO,
cursor: CursorReq(
mode: mode,
next: cursorNext,
),
// pagination: FeedPagination(offset: offset ?? ''),
// cursor: CursorReq(
// mode: mode,
// next: cursorNext,
// ),
mode: mode,
pagination: offset == null ? null : FeedPagination(offset: offset),
),
MainListReply.fromBuffer,
);
@@ -119,7 +120,7 @@ abstract final class ReplyGrpc {
type: Int64(type),
root: Int64(root),
dialog: Int64(dialog),
pagination: FeedPagination(offset: offset ?? ''),
pagination: offset == null ? null : FeedPagination(offset: offset),
),
DialogListReply.fromBuffer,
);

View File

@@ -1,3 +1,5 @@
import 'dart:async' show StreamSubscription;
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/http/search.dart';
import 'package:PiliPlus/models/common/search/article_search_type.dart';
@@ -54,16 +56,18 @@ class SearchPanelController<R extends SearchNumData<T>, T>
onReload().whenComplete(SmartDialog.dismiss);
}
StreamSubscription? _listener;
@override
void onInit() {
super.onInit();
try {
searchResultController = Get.find<SearchResultController>(tag: tag)
..toTopIndex.listen((index) {
if (index == searchType.index) {
scrollController.animToTop();
}
});
searchResultController = Get.find<SearchResultController>(tag: tag);
_listener = searchResultController!.toTopIndex.listen((index) {
if (index == searchType.index) {
scrollController.animToTop();
}
});
} catch (_) {}
queryData();
}
@@ -109,4 +113,10 @@ class SearchPanelController<R extends SearchNumData<T>, T>
scrollController.jumpToTop();
return super.onReload();
}
@override
void onClose() {
_listener?.cancel();
super.onClose();
}
}