chore: i18n in toast

This commit is contained in:
Tristan Yang
2023-01-19 08:39:57 +08:00
parent 1f7baef4b6
commit fd8c54e702
34 changed files with 107 additions and 86 deletions
+2 -1
View File
@@ -21,6 +21,7 @@ const AutoDeleteMessages = ({ id, type = "channel" }: Props) => {
const [updateSetting, { isSuccess }] = useUpdateAutoDeleteMsgMutation();
const [value, setValue] = useState<number>(setting?.expires_in ?? 0);
const { t } = useTranslation("setting", { keyPrefix: "auto_delete_msg" });
const { t: ct } = useTranslation();
const options = [
{ title: t("off"), value: 0 },
{ title: t("5_min"), value: 5 * 60 },
@@ -41,7 +42,7 @@ const AutoDeleteMessages = ({ id, type = "channel" }: Props) => {
};
useEffect(() => {
if (isSuccess) {
toast.success("Update Successfully!");
toast.success(ct("tip.update"));
}
}, [isSuccess]);
const originalVal = setting?.expires_in ?? 0;