Skip to content

Commit

Permalink
refactor(INJI-205): use extracted error constant to avoid hardcoding
Browse files Browse the repository at this point in the history
Signed-off-by: Kiruthika Jeyashankar <[email protected]>
  • Loading branch information
KiruthikaJeyashankar committed Oct 10, 2023
1 parent 9d3c9c2 commit 25c2bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions machines/issuersMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ export function selectIssuers(state: State) {

export function selectErrorMessageType(state: State) {
return state.context.errorMessage === '' ||
state.context.errorMessage === 'noInternetConnection'
state.context.errorMessage === ErrorMessage.NO_INTERNET
? state.context.errorMessage
: 'generic';
: ErrorMessage.GENERIC;
}

export function selectLoadingReason(state: State) {
Expand Down
3 changes: 2 additions & 1 deletion screens/Issuers/IssuersScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {HomeRouteProps} from '../../routes/main';
import {useIssuerScreenController} from './IssuerScreenController';
import {Loader} from '../../components/ui/Loader';
import testIDProps, {removeWhiteSpace} from '../../shared/commonUtil';
import {ErrorMessage} from '../../shared/openId4VCI/Utils';

export const IssuersScreen: React.FC<
HomeRouteProps | RootRouteProps
Expand Down Expand Up @@ -54,7 +55,7 @@ export const IssuersScreen: React.FC<
};

const isGenericError = () => {
return controller.errorMessageType === 'generic';
return controller.errorMessageType === ErrorMessage.GENERIC;
};

const goBack = () => {
Expand Down

0 comments on commit 25c2bd6

Please sign in to comment.