chore: skip picking if VEGA_URL set
This commit is contained in:
parent
b0bbae4c2e
commit
002738af70
@ -619,12 +619,6 @@ export const useEnvironment = create<EnvStore>()((set, get) => ({
|
|||||||
|
|
||||||
const state = get();
|
const state = get();
|
||||||
|
|
||||||
// skip picking up the best node if VEGA_URL env variable is set
|
|
||||||
if (state.VEGA_URL && isValidUrl(state.VEGA_URL)) {
|
|
||||||
state.setUrl(state.VEGA_URL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let storedUrl = LocalStorage.getItem(STORAGE_KEY);
|
let storedUrl = LocalStorage.getItem(STORAGE_KEY);
|
||||||
if (!isValidUrl(storedUrl)) {
|
if (!isValidUrl(storedUrl)) {
|
||||||
// remove invalid data from local storage
|
// remove invalid data from local storage
|
||||||
@ -649,6 +643,12 @@ export const useEnvironment = create<EnvStore>()((set, get) => ({
|
|||||||
console.warn(`Could not fetch node config from ${state.VEGA_CONFIG_URL}`);
|
console.warn(`Could not fetch node config from ${state.VEGA_CONFIG_URL}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip picking up the best node if VEGA_URL env variable is set
|
||||||
|
if (state.VEGA_URL && isValidUrl(state.VEGA_URL)) {
|
||||||
|
state.setUrl(state.VEGA_URL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// No url found in env vars or localStorage, AND no nodes were found in
|
// No url found in env vars or localStorage, AND no nodes were found in
|
||||||
// the config fetched from VEGA_CONFIG_URL, app initialization has failed
|
// the config fetched from VEGA_CONFIG_URL, app initialization has failed
|
||||||
if (!nodes || !nodes.length) {
|
if (!nodes || !nodes.length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user