diff --git a/public/locales/en/auth.json b/public/locales/en/auth.json index d233c6a4..a0e13ed6 100644 --- a/public/locales/en/auth.json +++ b/public/locales/en/auth.json @@ -26,6 +26,7 @@ "clear_local": "Clear local data" }, "continue": "Continue with Email", + "placeholder_name": "Enter your Name", "placeholder_email": "Enter your Email", "placeholder_pwd": "Enter Password", "placeholder_confirm_pwd": "Confirm Password", @@ -40,5 +41,10 @@ "signing_up": "Signing Up", "github_login_success": "GitHub Login Success!", "github_logging_in": "GitHub Logging in...", - "github_cb_tip": "Please close this window and return widget window" + "github_cb_tip": "Please close this window and return widget window", + "magic_link_expire": { + "title": "Magic link expired", + "desc": "Go back to your original VoceChat tab and request a new magic link.", + "desc_close": "You can close this window now." + } } diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 4b144f49..4658ee10 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -54,6 +54,7 @@ "tip": { "update": "Update Successfully!", "delete": "Delete Successfully!", + "reg": "Register Successfully!", "login": "Login Successfully!", "logout": "Logout Successfully!", "pin": "Pin Message Successfully!", diff --git a/public/locales/zh/auth.json b/public/locales/zh/auth.json index bf56f435..03aed26c 100644 --- a/public/locales/zh/auth.json +++ b/public/locales/zh/auth.json @@ -29,6 +29,7 @@ "check_email": "检查你的邮箱", "check_email_desc": "我们将链接已发送到你的邮箱:{{email}},请前往查收", "use_different": "使用其它邮箱", + "placeholder_name": "输入用户名", "placeholder_email": "输入邮箱地址", "placeholder_pwd": "输入密码", "placeholder_confirm_pwd": "确认密码", @@ -40,5 +41,10 @@ "signing_up": "注册中", "github_login_success": "Github授权成功!", "github_logging_in": "Github授权中...", - "github_cb_tip": "请关闭该窗口,并返回原界面" + "github_cb_tip": "请关闭该窗口,并返回原界面", + "magic_link_expire": { + "title": "邀请链接已过期!", + "desc": "请重新生成邀请链接", + "desc_close": "该网页可关闭" + } } diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index 532c6e9d..be85a4e4 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -56,6 +56,7 @@ "tip": { "update": "更新成功!", "delete": "删除成功!", + "reg": "注册成功!", "login": "登录成功!", "logout": "退出成功!", "pin": "消息置顶成功!", diff --git a/src/common/hook/useStreaming/chat.handler.ts b/src/common/hook/useStreaming/chat.handler.ts index 2ff75abf..a775f6f5 100644 --- a/src/common/hook/useStreaming/chat.handler.ts +++ b/src/common/hook/useStreaming/chat.handler.ts @@ -49,7 +49,7 @@ const handler = (data: ChatEvent, dispatch: AppDispatch, currState: CurrentState dispatch(updateAfterMid(mid)); break; } - const { ready, loginUid, readUsers = {}, readChannels = {} } = currState; + const { loginUid, readUsers = {}, readChannels = {} } = currState; const to = "gid" in target ? "channel" : "user"; const appendMessage = to == "user" ? addUserMsg : addChannelMsg; const self = from_uid == loginUid; diff --git a/src/routes/chat/index.tsx b/src/routes/chat/index.tsx index 48dffecc..3b5b62f4 100644 --- a/src/routes/chat/index.tsx +++ b/src/routes/chat/index.tsx @@ -56,12 +56,12 @@ function ChatPage() { {usersModalVisible && }
{sessionListVisible &&
} -
{isGuest ? : } - {isGuest &&
diff --git a/src/routes/reg/ExpiredTip.tsx b/src/routes/reg/ExpiredTip.tsx index 7d595ba6..c8b60132 100644 --- a/src/routes/reg/ExpiredTip.tsx +++ b/src/routes/reg/ExpiredTip.tsx @@ -1,10 +1,12 @@ +import { useTranslation } from "react-i18next"; export default function ExpiredTip() { + const { t } = useTranslation("auth", { keyPrefix: "magic_link_expire" }); return (
-
Magic link expired
-

Go back to your original VoceChat tab and request a new magic link.

-

You can close this window now.

+
{t("title")}
+

{t("desc")}

+

{t("desc_close")}

); } diff --git a/src/routes/sendMagicLink/index.tsx b/src/routes/sendMagicLink/index.tsx index c3fe05a6..c7c7c1bf 100644 --- a/src/routes/sendMagicLink/index.tsx +++ b/src/routes/sendMagicLink/index.tsx @@ -10,9 +10,11 @@ import { useTranslation } from "react-i18next"; import SocialLoginButtons from "../login/SocialLoginButtons"; import Divider from "../../common/component/Divider"; import SignInLink from "../reg/SignInLink"; +import { useAppSelector } from "../../app/store"; export default function SendMagicLinkPage() { const { t } = useTranslation("auth"); + const serverName = useAppSelector(store => store.server.name); const [sent, setSent] = useState(false); const [sendMagicLink, { isSuccess, isLoading, error }] = useSendLoginMagicLinkMutation(); const navigateTo = useNavigate(); @@ -72,7 +74,7 @@ export default function SendMagicLinkPage() { <>
logo -

{t("enter")}VoceChat

+

{t("enter")} {serverName}

{t("placeholder_email")}
@@ -92,7 +94,7 @@ export default function SendMagicLinkPage() {
- +