mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: reply2reply
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||||
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/video/reply/item.dart';
|
import 'package:PiliPlus/models/video/reply/item.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_controller.dart';
|
import 'package:PiliPlus/pages/common/common_controller.dart';
|
||||||
@@ -54,21 +53,21 @@ class VideoReplyReplyController extends CommonController
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future queryData([bool isRefresh = true]) async {
|
Future queryData([bool isRefresh = true]) async {
|
||||||
if (GlobalData().grpcReply &&
|
// if (GlobalData().grpcReply &&
|
||||||
!isDialogue &&
|
// !isDialogue &&
|
||||||
currentPage == 1 &&
|
// currentPage == 1 &&
|
||||||
!hasRoot &&
|
// !hasRoot &&
|
||||||
firstFloor == null &&
|
// firstFloor == null &&
|
||||||
rpid != null) {
|
// rpid != null) {
|
||||||
await GrpcRepo.replyInfo(
|
// await GrpcRepo.replyInfo(
|
||||||
rpid: rpid!,
|
// rpid: rpid!,
|
||||||
).then((res) {
|
// ).then((res) {
|
||||||
if (res['status'] && (res['data']?.mid ?? -1) > 0) {
|
// if (res['status'] && (res['data']?.mid ?? -1) > 0) {
|
||||||
firstFloor = res['data'];
|
// firstFloor = res['data'];
|
||||||
hasRoot = true;
|
// hasRoot = true;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
return super.queryData(isRefresh);
|
return super.queryData(isRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,8 +81,12 @@ class VideoReplyReplyController extends CommonController
|
|||||||
bool customHandleResponse(Success response) {
|
bool customHandleResponse(Success response) {
|
||||||
if (GlobalData().grpcReply) {
|
if (GlobalData().grpcReply) {
|
||||||
dynamic replies = response.response;
|
dynamic replies = response.response;
|
||||||
if (replies is DetailListReply && cursor == null) {
|
// reply2Reply // isDialogue.not
|
||||||
|
if (replies is DetailListReply) {
|
||||||
count.value = replies.root.count.toInt();
|
count.value = replies.root.count.toInt();
|
||||||
|
if (cursor == null && firstFloor == null) {
|
||||||
|
firstFloor = replies.root;
|
||||||
|
}
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
index = replies.root.replies
|
index = replies.root.replies
|
||||||
.map((item) => item.id.toInt())
|
.map((item) => item.id.toInt())
|
||||||
|
|||||||
Reference in New Issue
Block a user