From e206bdf900d5808a1a7909acfc2cf9002a03d5c4 Mon Sep 17 00:00:00 2001 From: gww Date: Tue, 27 Jan 2026 14:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0=E5=8A=A0lo?= =?UTF-8?q?ading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/profile.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/profile.tsx b/app/profile.tsx index 24e9ea2..c91235e 100644 --- a/app/profile.tsx +++ b/app/profile.tsx @@ -28,16 +28,27 @@ type EditNicknameModalProps = { function EditNicknameModal({ initialName, onConfirm, onCancel }: EditNicknameModalProps) { const [name, setName] = useState(initialName) + const [loading, setLoading] = useState(false) useEffect(() => { setName(initialName) }, [initialName]) + const handleConfirm = async () => { + setLoading(true) + try { + await onConfirm(name) + } finally { + setLoading(false) + } + } + return ( onConfirm(name)} + onConfirm={handleConfirm} /> ) }