Review fixes based on comments

Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
This commit is contained in:
Antoine Mazeas 2020-01-20 11:19:41 +01:00
parent 3aadf0c2a9
commit f65f4c540b
2 changed files with 2 additions and 4 deletions

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
var BASE_PATH = "/_matrix/maubot/v1" let BASE_PATH = "/_matrix/maubot/v1"
export function setBasePath(basePath) { export function setBasePath(basePath) {
BASE_PATH = basePath BASE_PATH = basePath
@ -245,7 +245,6 @@ export async function doClientAuth(server, type, username, password) {
} }
export default { export default {
BASE_PATH,
login, ping, setBasePath, getFeatures, remoteGetFeatures, login, ping, setBasePath, getFeatures, remoteGetFeatures,
openLogSocket, openLogSocket,
debugOpenFile, debugOpenFileEnabled, updateDebugOpenFileEnabled, debugOpenFile, debugOpenFileEnabled, updateDebugOpenFileEnabled,

View file

@ -47,10 +47,9 @@ class Main extends Component {
}) })
const apiPathJson = await resp.json() const apiPathJson = await resp.json()
const apiPath = apiPathJson.api_path const apiPath = apiPathJson.api_path
console.log(apiPath)
api.setBasePath(`${apiPath}`) api.setBasePath(`${apiPath}`)
} catch (err) { } catch (err) {
console.error(err) console.error("Failed to get API path:", err)
} }
} }