mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user