mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +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) {
|
if (!state.busy) {
|
||||||
try {
|
try {
|
||||||
updateState({ busy: true });
|
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) {
|
if (unclaimed) {
|
||||||
await setNodeStatus(state.server, state.token);
|
await setNodeStatus(node, token);
|
||||||
}
|
}
|
||||||
const config = await getNodeConfig(state.server, state.token);
|
const config = await getNodeConfig(node, token);
|
||||||
const { server, token } = state;
|
updateState({ server: node, busy: false });
|
||||||
updateState({ busy: false });
|
navigate('/dashboard', { state: { config, server: node, token }});
|
||||||
navigate('/dashboard', { state: { config, server, token }});
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -51,7 +51,7 @@ export function useReset() {
|
|||||||
if (!state.busy) {
|
if (!state.busy) {
|
||||||
try {
|
try {
|
||||||
updateState({ busy: true });
|
updateState({ busy: true });
|
||||||
await app.actions.access(state.server, state.token);
|
await app.actions.access(state.server.trim(), state.token);
|
||||||
updateState({ busy: false });
|
updateState({ busy: false });
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user