From e8dc4efe4ddbbfbf26b540860811854ff0ebcc4d Mon Sep 17 00:00:00 2001 From: Dmytro Vovk Date: Mon, 12 Aug 2024 16:45:25 +0100 Subject: [PATCH] save --- src/Network/APIHandler.tsx | 2 ++ src/app/store/connectionSlice.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Network/APIHandler.tsx b/src/Network/APIHandler.tsx index b9da298..17d46e7 100644 --- a/src/Network/APIHandler.tsx +++ b/src/Network/APIHandler.tsx @@ -45,6 +45,7 @@ export const getActiveSessionPin = (): string => { export const sessionBaseUrl = (v2: boolean = false) => { const sessionId = getActiveSessionPin(); let addr = store.getState().connection.backendAddress; + console.log("addr: ", addr); let apiUrl = `${addr}/api`; if (v2) { @@ -57,6 +58,7 @@ export const sessionBaseUrl = (v2: boolean = false) => { export const currentNodeUrl = (v2: boolean = false) => { if (isLocalVersion()) { let addr = store.getState().connection.backendAddress; + console.log("1addr: ", addr); return `${addr}/debug/diag`; } else { const baseUrl = sessionBaseUrl(v2); diff --git a/src/app/store/connectionSlice.ts b/src/app/store/connectionSlice.ts index 96187a6..8fa0442 100644 --- a/src/app/store/connectionSlice.ts +++ b/src/app/store/connectionSlice.ts @@ -19,7 +19,6 @@ const initialState: ConnectionState = { isConnectedToInternet: true, isConnectedToNode: true, nodeConnectionType: NodeConnectionType.Unknown, - //backendAddress: "http://localhost:8080" backendAddress: window.location.origin }; @@ -37,6 +36,7 @@ export const connectionSlice = createSlice({ state.nodeConnectionType = action.payload; }, setBackendAddress: (state, action: PayloadAction) => { + console.log("Setting backend address to: ", action.payload); state.backendAddress = action.payload; }, resetConectionState: () => initialState