mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
trimming whitespace on admin server name
This commit is contained in:
parent
67f905ddd4
commit
acc846c88f
@ -66,14 +66,15 @@ export function useAdmin() {
|
||||
if (!state.busy) {
|
||||
try {
|
||||
updateState({ busy: true });
|
||||
const unclaimed = await getNodeStatus(state.server);
|
||||
const node = state.server.trim();
|
||||
const token = state.token;
|
||||
const unclaimed = await getNodeStatus(node);
|
||||
if (unclaimed) {
|
||||
await setNodeStatus(state.server, state.token);
|
||||
await setNodeStatus(node, token);
|
||||
}
|
||||
const config = await getNodeConfig(state.server, state.token);
|
||||
const { server, token } = state;
|
||||
updateState({ busy: false });
|
||||
navigate('/dashboard', { state: { config, server, token }});
|
||||
const config = await getNodeConfig(node, token);
|
||||
updateState({ server: node, busy: false });
|
||||
navigate('/dashboard', { state: { config, server: node, token }});
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
|
@ -51,7 +51,7 @@ export function useReset() {
|
||||
if (!state.busy) {
|
||||
try {
|
||||
updateState({ busy: true });
|
||||
await app.actions.access(state.server, state.token);
|
||||
await app.actions.access(state.server.trim(), state.token);
|
||||
updateState({ busy: false });
|
||||
}
|
||||
catch (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user