fix: overview
This commit is contained in:
@@ -334,7 +334,7 @@ export const serverApi = createApi({
|
|||||||
url: `/license`
|
url: `/license`
|
||||||
}),
|
}),
|
||||||
async onQueryStarted(data, { dispatch, queryFulfilled, getState }) {
|
async onQueryStarted(data, { dispatch, queryFulfilled, getState }) {
|
||||||
// vocechat官方demo 则忽略
|
// vocechat 官方 demo 则忽略
|
||||||
if (IS_OFFICIAL_DEMO) return;
|
if (IS_OFFICIAL_DEMO) return;
|
||||||
const rootStore = getState() as RootState;
|
const rootStore = getState() as RootState;
|
||||||
const { upgraded: prevValue } = rootStore.server;
|
const { upgraded: prevValue } = rootStore.server;
|
||||||
@@ -432,6 +432,7 @@ export const {
|
|||||||
useGetSMTPStatusQuery,
|
useGetSMTPStatusQuery,
|
||||||
useSendTestEmailMutation,
|
useSendTestEmailMutation,
|
||||||
useUpdateFirebaseConfigMutation,
|
useUpdateFirebaseConfigMutation,
|
||||||
|
useGetFirebaseConfigQuery,
|
||||||
useLazyGetFirebaseConfigQuery,
|
useLazyGetFirebaseConfigQuery,
|
||||||
useLazyGetAgoraConfigQuery,
|
useLazyGetAgoraConfigQuery,
|
||||||
useLazyGetSMTPConfigQuery,
|
useLazyGetSMTPConfigQuery,
|
||||||
|
|||||||
+19
-12
@@ -4,10 +4,10 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useLazyGetAgoraConfigQuery,
|
useGetAgoraConfigQuery,
|
||||||
useLazyGetFirebaseConfigQuery,
|
useGetFirebaseConfigQuery,
|
||||||
useLazyGetLoginConfigQuery,
|
useGetLoginConfigQuery,
|
||||||
useLazyGetSMTPConfigQuery,
|
useGetSMTPConfigQuery,
|
||||||
useUpdateAgoraConfigMutation,
|
useUpdateAgoraConfigMutation,
|
||||||
useUpdateFirebaseConfigMutation,
|
useUpdateFirebaseConfigMutation,
|
||||||
useUpdateLoginConfigMutation,
|
useUpdateLoginConfigMutation,
|
||||||
@@ -33,10 +33,21 @@ export default function useConfig(config: keyof ConfigMap = "smtp") {
|
|||||||
useUpdateAgoraConfigMutation();
|
useUpdateAgoraConfigMutation();
|
||||||
const [updateFirebaseConfig, { isSuccess: FirebaseUpdated, isLoading: FirebaseUpdating }] =
|
const [updateFirebaseConfig, { isSuccess: FirebaseUpdated, isLoading: FirebaseUpdating }] =
|
||||||
useUpdateFirebaseConfigMutation();
|
useUpdateFirebaseConfigMutation();
|
||||||
const [getAgoraConfig, { data: agoraConfig }] = useLazyGetAgoraConfigQuery();
|
const { refetch: getAgoraConfig, data: agoraConfig } = useGetAgoraConfigQuery(undefined, {
|
||||||
const [getLoginConfig, { data: loginConfig }] = useLazyGetLoginConfigQuery();
|
skip: config !== "agora"
|
||||||
const [getSMTPConfig, { data: smtpConfig }] = useLazyGetSMTPConfigQuery();
|
});
|
||||||
const [getFirebaseConfig, { data: firebaseConfig }] = useLazyGetFirebaseConfigQuery();
|
const { refetch: getLoginConfig, data: loginConfig } = useGetLoginConfigQuery(undefined, {
|
||||||
|
skip: config !== "login"
|
||||||
|
});
|
||||||
|
const { refetch: getSMTPConfig, data: smtpConfig } = useGetSMTPConfigQuery(undefined, {
|
||||||
|
skip: config !== "smtp"
|
||||||
|
});
|
||||||
|
const { refetch: getFirebaseConfig, data: firebaseConfig } = useGetFirebaseConfigQuery(
|
||||||
|
undefined,
|
||||||
|
{
|
||||||
|
skip: config !== "firebase"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const updateFns = {
|
const updateFns = {
|
||||||
login: updateLoginConfig,
|
login: updateLoginConfig,
|
||||||
@@ -79,10 +90,6 @@ export default function useConfig(config: keyof ConfigMap = "smtp") {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
refetch();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (updated) {
|
if (updated) {
|
||||||
toast.success(ct("tip.update"));
|
toast.success(ct("tip.update"));
|
||||||
|
|||||||
Reference in New Issue
Block a user