removing domain update flag, not needed

This commit is contained in:
balzack 2023-05-20 22:11:14 -07:00
parent 758dcfb3c8
commit b89de05885
3 changed files with 6 additions and 13 deletions

View File

@ -1,8 +1,8 @@
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function setNodeConfig(server, token, config, updated) {
export async function setNodeConfig(server, token, config) {
let body = JSON.stringify(config);
let settings = await fetchWithTimeout(`https://${server}/admin/config?token=${token}&domain=${updated}`, { method: 'PUT', body });
let settings = await fetchWithTimeout(`https://${server}/admin/config?token=${token}`, { method: 'PUT', body });
checkResponse(settings);
}

View File

@ -22,7 +22,6 @@ export function useDashboard(config, server, token) {
accessUser: false,
accessId: null,
domain: null,
updated: false,
storage: null,
keyType: null,
enableImage: true,
@ -61,7 +60,7 @@ export function useDashboard(config, server, token) {
useEffect(() => {
const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config;
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, pushSupported, enableIce, iceUrl, iceUsername, icePassword, updated: false });
updateState({ keyType, storage: accountStorage.toString(), domain, enableImage, enableAudio, enableVideo, pushSupported, enableIce, iceUrl, iceUsername, icePassword });
}, [config]);
useEffect(() => {
@ -96,7 +95,7 @@ export function useDashboard(config, server, token) {
updateState({ accessUser: false });
},
setDomain: (domain) => {
updateState({ domain, updated: true });
updateState({ domain });
},
setStorage: (storage) => {
updateState({ storage: Number(storage.replace(/[^0-9]/g, '')) });
@ -129,9 +128,9 @@ export function useDashboard(config, server, token) {
updateState({ icePassword });
},
saveConfig: async () => {
const { storage, domain, updated, keyType, enableImage, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state;
const { storage, domain, keyType, enableImage, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state;
const config = { accountStorage: Number(storage), domain, keyType, enableImage, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword };
await setNodeConfig(server, token, config, updated);
await setNodeConfig(server, token, config);
},
enableUser: async (accountId, enabled) => {
await setAccountStatus(server, token, accountId, !enabled);

View File

@ -123,12 +123,6 @@ paths:
required: true
schema:
type: string
- name: domain
in: query
description: if domain should be updated
required: false
schema:
type: boolean
responses:
'200':
description: success