diff --git a/web/src/features/settings/account-section.tsx b/web/src/features/settings/account-section.tsx index 8eb6504..0f7fc38 100644 --- a/web/src/features/settings/account-section.tsx +++ b/web/src/features/settings/account-section.tsx @@ -41,6 +41,11 @@ export function AccountSection() { switchIdentity(null) } catch (error) { + // 账号在这台设备上的会话已经失效,客户端也已经换成新的游客,退出登录的目的已经达到。 + if (error instanceof IdentityRenewedError) { + window.location.reload() + return + } notificationStore.error(errorMessage(error)) setBusy(false) } @@ -160,7 +165,7 @@ function PasswordDialog({ onClose }: { onClose: () => void }) { onClose() } catch (error) { - notificationStore.error(error instanceof IdentityRenewedError ? '密码没有修改,再试一次。' : errorMessage(error, { INVALID_ARGUMENT: '新密码要 8 到 128 位。' })) + notificationStore.error(error instanceof IdentityRenewedError ? '密码没有修改,再试一次。' : errorMessage(error, { INVALID_ARGUMENT: '密码要 8 到 128 位。' })) setBusy(false) } } @@ -169,7 +174,7 @@ function PasswordDialog({ onClose }: { onClose: () => void }) {