diff --git a/package.json b/package.json index 06a13bc6..0d0a1d2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vocechat-web", - "version": "0.3.34", + "version": "0.3.35", "private": true, "homepage": "https://voce.chat", "dependencies": { diff --git a/src/routes/setting/Overview/FrontendURL.tsx b/src/routes/setting/Overview/FrontendURL.tsx index cd269d98..f2e1b046 100644 --- a/src/routes/setting/Overview/FrontendURL.tsx +++ b/src/routes/setting/Overview/FrontendURL.tsx @@ -1,14 +1,14 @@ // import React from 'react' import { useTranslation } from 'react-i18next'; -import { useUpdateFrontendUrlMutation } from '../../../app/services/server'; +import { useGetFrontendUrlQuery, useUpdateFrontendUrlMutation } from '../../../app/services/server'; import StyledInput from "../../../common/component/styled/Input"; import StyledButton from "../../../common/component/styled/Button"; import { ChangeEvent, useState, useEffect } from 'react'; import { toast } from 'react-hot-toast'; -import ServerVersionChecker from '../../../common/component/ServerVersionChecker'; // type Props = {} const Index = () => { + const { data, isSuccess: getUrlSuccess } = useGetFrontendUrlQuery(); const [url, setUrl] = useState(location.origin); const { t } = useTranslation("setting"); const { t: ct } = useTranslation(); @@ -25,7 +25,12 @@ const Index = () => { toast.success("Update Successfully!"); } }, [isSuccess]); - + useEffect(() => { + if (getUrlSuccess && data) { + setUrl(data); + } + }, [getUrlSuccess, data]); + // if(!fetch) return (
{t("overview.url.title")}
@@ -35,10 +40,9 @@ const Index = () => {