From 55138957b773baa867e486b267ab9e71b33ae735 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 13 May 2025 18:58:31 +0800 Subject: [PATCH] fix: zanbtn state Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/reply/widgets/zan_grpc.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pages/video/reply/widgets/zan_grpc.dart b/lib/pages/video/reply/widgets/zan_grpc.dart index e41a2031a..8c1b3bc10 100644 --- a/lib/pages/video/reply/widgets/zan_grpc.dart +++ b/lib/pages/video/reply/widgets/zan_grpc.dart @@ -47,7 +47,9 @@ class _ZanButtonGrpcState extends State { } else { widget.replyItem.replyControl.action = $fixnum.Int64.ZERO; } - setState(() {}); + if (mounted) { + setState(() {}); + } } else { SmartDialog.showToast(res['msg']); } @@ -75,7 +77,9 @@ class _ZanButtonGrpcState extends State { widget.replyItem.like -= $fixnum.Int64.ONE; widget.replyItem.replyControl.action = $fixnum.Int64.ZERO; } - setState(() {}); + if (mounted) { + setState(() {}); + } } else { SmartDialog.showToast(res['msg']); }