do not check uploadPictureIconState

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-27 20:54:57 +08:00
parent b51c646415
commit dff6b6486d
2 changed files with 9 additions and 12 deletions

View File

@@ -101,16 +101,12 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
onReload(); onReload();
} }
(bool inputDisable, bool canUploadPic, String? hint) get replyHint { (bool inputDisable, String? hint) get replyHint {
String? hint; String? hint;
bool canUploadPic = true;
bool inputDisable = false; bool inputDisable = false;
try { try {
if (subjectControl case final subjectControl?) { if (subjectControl case final subjectControl?) {
inputDisable = subjectControl.inputDisable; inputDisable = subjectControl.inputDisable;
canUploadPic =
subjectControl.uploadPictureIconState == .EditorIconState_DEFAULT ||
subjectControl.uploadPictureIconState == .EditorIconState_ENABLE;
if (subjectControl.hasRootText()) { if (subjectControl.hasRootText()) {
final rootText = subjectControl.rootText; final rootText = subjectControl.rootText;
if (inputDisable) { if (inputDisable) {
@@ -122,7 +118,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
} }
} }
} catch (_) {} } catch (_) {}
return (inputDisable, canUploadPic, hint); return (inputDisable, hint);
} }
void onReply( void onReply(
@@ -131,9 +127,8 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
ReplyInfo? replyItem, ReplyInfo? replyItem,
int? replyType, int? replyType,
}) { }) {
if (loadingState.value case Error error) { if (loadingState.value case Error(:final errMsg, :final code)) {
final errMsg = error.errMsg; if (errMsg != null && (code == 12061 || code == 12002)) {
if (errMsg != null && (error.code == 12061 || error.code == 12002)) {
SmartDialog.showToast(errMsg); SmartDialog.showToast(errMsg);
return; return;
} }
@@ -141,7 +136,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
assert(replyItem != null || (oid != null && replyType != null)); assert(replyItem != null || (oid != null && replyType != null));
final (bool inputDisable, bool canUploadPic, String? hint) = replyHint; final (bool inputDisable, String? hint) = replyHint;
if (inputDisable) { if (inputDisable) {
return; return;
} }
@@ -159,7 +154,9 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
replyType: replyItem?.type.toInt() ?? replyType!, replyType: replyItem?.type.toInt() ?? replyType!,
replyItem: replyItem, replyItem: replyItem,
items: savedReplies[key], items: savedReplies[key],
canUploadPic: canUploadPic,
/// hd api deprecated
// canUploadPic: canUploadPic,
onSave: (reply) { onSave: (reply) {
if (reply.isEmpty) { if (reply.isEmpty) {
savedReplies.remove(key); savedReplies.remove(key);

View File

@@ -164,7 +164,7 @@ class VideoReplyReplyController extends ReplyController
}) { }) {
assert(replyItem != null && index != null); assert(replyItem != null && index != null);
final (bool inputDisable, bool canUploadPic, String? hint) = replyHint; final (bool inputDisable, String? hint) = replyHint;
if (inputDisable) { if (inputDisable) {
return; return;
} }