Skip to content

Commit

Permalink
getting function back to network
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldoglas committed Mar 4, 2024
1 parent 992ed3a commit 2931b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/libs/Network/NetworkStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ function isSupportRequest(command: string): boolean {
return [WRITE_COMMANDS.OPEN_APP, SIDE_EFFECT_REQUEST_COMMANDS.RECONNECT_APP, SIDE_EFFECT_REQUEST_COMMANDS.OPEN_REPORT].some((cmd) => cmd === command);
}

function isSupportAuthToken(): boolean {
return authTokenType === CONST.AUTH_TOKEN_TYPES.SUPPORT;
}

function setAuthToken(newAuthToken: string | null) {
authToken = newAuthToken;
}
Expand Down Expand Up @@ -133,5 +137,6 @@ export {
setIsAuthenticating,
getCredentials,
checkRequiredData,
isSupportAuthToken,
isSupportRequest,
};
3 changes: 1 addition & 2 deletions src/libs/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import HttpUtils from './HttpUtils';
import type Middleware from './Middleware/types';
import enhanceParameters from './Network/enhanceParameters';
import * as NetworkStore from './Network/NetworkStore';
import { isSupportAuthToken } from './actions/Session';

let middlewares: Middleware[] = [];

Expand All @@ -13,7 +12,7 @@ function makeXHR(request: Request): Promise<Response | void> {
return NetworkStore.hasReadRequiredDataFromStorage().then((): Promise<Response | void> => {
// If we're using the Supportal token and this is not a Supportal request
// let's just return a promise that will resolve itself.
if (isSupportAuthToken() && !NetworkStore.isSupportRequest(request.command)) {
if (NetworkStore.isSupportAuthToken() && !NetworkStore.isSupportRequest(request.command)) {
return new Promise<void>((resolve) => {
resolve();
});
Expand Down

0 comments on commit 2931b5e

Please sign in to comment.