chore: fix

This commit is contained in:
Tristan Yang
2024-12-28 08:24:46 +08:00
parent cf782b330b
commit e6904715cd
2 changed files with 1 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vocechat-web", "name": "vocechat-web",
"version": "0.8.6", "version": "0.8.7",
"homepage": "https://voce.chat", "homepage": "https://voce.chat",
"dependencies": { "dependencies": {
"@metamask/onboarding": "^1.0.1", "@metamask/onboarding": "^1.0.1",
@@ -7,14 +7,11 @@ import toast from "react-hot-toast";
import { shallowEqual } from "react-redux"; import { shallowEqual } from "react-redux";
import ServerVersionChecker from "@/components/ServerVersionChecker"; import ServerVersionChecker from "@/components/ServerVersionChecker";
import Toggle from "@/components/styled/Toggle"; import Toggle from "@/components/styled/Toggle";
import useConfig from "@/hooks/useConfig";
import { SMTPConfig } from "@/types/server";
import { useUpdateInfoMutation } from "@/app/services/user"; import { useUpdateInfoMutation } from "@/app/services/user";
type Props = {}; type Props = {};
const UserMsgEmailNotify = ({}: Props) => { const UserMsgEmailNotify = ({}: Props) => {
const [updateInfo, { isSuccess }] = useUpdateInfoMutation(); const [updateInfo, { isSuccess }] = useUpdateInfoMutation();
const { values } = useConfig("smtp");
const { t } = useTranslation("setting"); const { t } = useTranslation("setting");
const { t: ct } = useTranslation(); const { t: ct } = useTranslation();
const { refetch } = useGetSystemCommonQuery(); const { refetch } = useGetSystemCommonQuery();
@@ -33,13 +30,6 @@ const UserMsgEmailNotify = ({}: Props) => {
} }
}, [isSuccess]); }, [isSuccess]);
const toggleEnable = () => { const toggleEnable = () => {
if (!msgNotify) {
// 检查下 SMTP 开关
if (!(values as SMTPConfig).enabled) {
toast.error("Enable SMTP first!");
return;
}
}
updateInfo({ msg_smtp_notify_enable: !msgNotify }); updateInfo({ msg_smtp_notify_enable: !msgNotify });
}; };
if (!ServerMsgNotify) return null; if (!ServerMsgNotify) return null;