Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
dvovk committed Aug 12, 2024
1 parent b1e5338 commit e8dc4ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Network/APIHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/app/store/connectionSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const initialState: ConnectionState = {
isConnectedToInternet: true,
isConnectedToNode: true,
nodeConnectionType: NodeConnectionType.Unknown,
//backendAddress: "http://localhost:8080"
backendAddress: window.location.origin
};

Expand All @@ -37,6 +36,7 @@ export const connectionSlice = createSlice({
state.nodeConnectionType = action.payload;
},
setBackendAddress: (state, action: PayloadAction<string>) => {
console.log("Setting backend address to: ", action.payload);
state.backendAddress = action.payload;
},
resetConectionState: () => initialState
Expand Down

0 comments on commit e8dc4ef

Please sign in to comment.