From f62e6e4b63fabd32e32f3307f968f4e414a59152 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 3 May 2022 20:48:07 -0500 Subject: explicitly append urlBase --- src/web/src/components/App.js | 46 +++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 26 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 9c64c1a9..09f3f742 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import { Route, Link, Switch, Redirect } from "react-router-dom"; import * as session from '../lib/session'; -import * as application from '../lib/application'; import { connect, disconnect } from '../lib/server'; +import { urlBase } from '../config'; import { createApplicationHubConnection } from '../lib/hubFactory'; @@ -39,7 +39,6 @@ const initialState = { initialized: false, error: false, retriesExhausted: false, - urlBase: '', }; class App extends Component { @@ -52,12 +51,7 @@ class App extends Component { init = async () => { this.setState({ initialized: false }, async () => { try { - const [urlBase, securityEnabled] = await Promise.all([ - application.getUrlBase(), - session.getSecurityEnabled()] - ); - - this.setState({ urlBase }); + const securityEnabled = await session.getSecurityEnabled(); if (!securityEnabled) { console.debug('application security is not enabled, per api call') @@ -116,7 +110,7 @@ class App extends Component { }; render = () => { - const { login, applicationState = {}, applicationOptions = {}, error, initialized, retriesExhausted, urlBase = '' } = this.state; + const { login, applicationState = {}, applicationOptions = {}, error, initialized, retriesExhausted } = this.state; const { version = {}, server } = applicationState; const { isUpdateAvailable, current, latest } = version; @@ -157,37 +151,37 @@ class App extends Component { {version.isCanary && Canary } - + Search - + Downloads - + Uploads - + Rooms - + Chat - + Users - + Browse @@ -228,7 +222,7 @@ class App extends Component { href="https://github.com/slskd/slskd/releases">See Release Notes } - + System @@ -249,15 +243,15 @@ class App extends Component { - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - this.withTokenCheck()}/> - + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + this.withTokenCheck()}/> + -- cgit v1.2.3