mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
chore: deprecate prev reply, videopage
Closes #579 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,7 +5,6 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/url_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -88,24 +87,14 @@ class HtmlRenderController extends ReplyController {
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() {
|
||||
return GlobalData().grpcReply
|
||||
? ReplyHttp.replyListGrpc(
|
||||
type: type,
|
||||
oid: oid.value,
|
||||
cursor: CursorReq(
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode.value,
|
||||
),
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
oid: oid.value,
|
||||
nextOffset: nextOffset,
|
||||
type: type,
|
||||
sort: sortType.value.index,
|
||||
page: currentPage,
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
);
|
||||
return ReplyHttp.replyListGrpc(
|
||||
type: type,
|
||||
oid: oid.value,
|
||||
cursor: CursorReq(
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode.value,
|
||||
),
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,8 @@ import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/repost_dyn_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
@@ -167,7 +165,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
void replyReply(context, replyItem, id, isTop) {
|
||||
EasyThrottle.throttle('replyReply', const Duration(milliseconds: 500), () {
|
||||
int oid = replyItem.oid.toInt();
|
||||
int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid;
|
||||
int rpid = replyItem.id.toInt();
|
||||
Widget replyReplyPage(
|
||||
[bool automaticallyImplyLeading = true,
|
||||
VoidCallback? onDispose]) =>
|
||||
@@ -786,58 +784,36 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return GlobalData().grpcReply
|
||||
? ReplyItemGrpc(
|
||||
replyItem: loadingState.response.replies[index],
|
||||
showReplyRow: true,
|
||||
replyLevel: '1',
|
||||
replyReply: (replyItem, id, isTop) =>
|
||||
replyReply(context, replyItem, id, isTop),
|
||||
replyType: ReplyType.values[type],
|
||||
onReply: () {
|
||||
_htmlRenderCtr.onReply(
|
||||
context,
|
||||
replyItem: loadingState.response.replies[index],
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
onDelete: _htmlRenderCtr.onMDelete,
|
||||
isTop: _htmlRenderCtr.hasUpTop && index == 0,
|
||||
upMid: loadingState.response.subjectControl.upMid,
|
||||
callback: _getImageCallback,
|
||||
onCheckReply: (item) =>
|
||||
_htmlRenderCtr.onCheckReply(context, item),
|
||||
)
|
||||
: ReplyItem(
|
||||
replyItem: loadingState.response.replies[index],
|
||||
showReplyRow: true,
|
||||
replyLevel: '1',
|
||||
replyReply: (replyItem, id, isTop) =>
|
||||
replyReply(context, replyItem, id, isTop),
|
||||
replyType: ReplyType.values[type],
|
||||
onReply: () {
|
||||
_htmlRenderCtr.onReply(
|
||||
context,
|
||||
replyItem: loadingState.response.replies[index],
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
onDelete: _htmlRenderCtr.onMDelete,
|
||||
callback: _getImageCallback,
|
||||
onCheckReply: (item) =>
|
||||
_htmlRenderCtr.onCheckReply(context, item),
|
||||
);
|
||||
return ReplyItemGrpc(
|
||||
replyItem: loadingState.response.replies[index],
|
||||
showReplyRow: true,
|
||||
replyLevel: '1',
|
||||
replyReply: (replyItem, id, isTop) =>
|
||||
replyReply(context, replyItem, id, isTop),
|
||||
replyType: ReplyType.values[type],
|
||||
onReply: () {
|
||||
_htmlRenderCtr.onReply(
|
||||
context,
|
||||
replyItem: loadingState.response.replies[index],
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
onDelete: _htmlRenderCtr.onMDelete,
|
||||
isTop: _htmlRenderCtr.hasUpTop && index == 0,
|
||||
upMid: loadingState.response.subjectControl.upMid,
|
||||
callback: _getImageCallback,
|
||||
onCheckReply: (item) =>
|
||||
_htmlRenderCtr.onCheckReply(context, item),
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
: HttpError(
|
||||
callback: _htmlRenderCtr.onReload,
|
||||
),
|
||||
Error() => replyErrorWidget(
|
||||
context,
|
||||
true,
|
||||
loadingState.errMsg,
|
||||
_htmlRenderCtr.onReload,
|
||||
Error() => errorWidget(
|
||||
errMsg: loadingState.errMsg,
|
||||
callback: _htmlRenderCtr.onReload,
|
||||
),
|
||||
LoadingState() => throw UnimplementedError(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user