Skip to content

Commit

Permalink
feat(mosip#625):[Tilak/Adityan] Refactor names in store error flow
Browse files Browse the repository at this point in the history
  • Loading branch information
tilak-puli committed Mar 14, 2023
1 parent 7248718 commit 28c5d86
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"header": "{{vcLabel}} details",
"save": "Save {{vcLabel}}",
"verifyAndSave": "Verify and save",
"reject": "Reject",
"discard": "Discard",
"goToReceivedVCTab": "View Received {{vcLabel}}",
"errors": {
Expand Down
2 changes: 1 addition & 1 deletion machines/openIdBle/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ export function selectIsAccepting(state: State) {
return state.matches('reviewing.accepting');
}

export function selectIsSavingFailedIdle(state: State) {
export function selectIsSavingFailedInIdle(state: State) {
return state.matches('reviewing.savingFailed.idle');
}

Expand Down
1 change: 1 addition & 0 deletions screens/Request/ReceiveVcScreen.strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"header": "{{vcLabel}} details",
"save": "Save {{vcLabel}}",
"verifyAndSave": "Verify and save",
"reject": "Reject",
"discard": "Discard",
"goToReceivedVCTab": "View Received {{vcLabel}}",
"errors": {
Expand Down
2 changes: 1 addition & 1 deletion screens/Request/ReceiveVcScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const ReceiveVcScreen: React.FC = () => {
/>

<MessageOverlay
isVisible={controller.isSavingFailedIdle}
isVisible={controller.IsSavingFailedInIdle}
title={t('errors.savingFailed.title', {
vcLabel: controller.vcLabel.singular,
})}
Expand Down
7 changes: 5 additions & 2 deletions screens/Request/ReceiveVcScreenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { selectVcLabel } from '../../machines/settings';
import { GlobalContext } from '../../shared/GlobalContext';
import {
selectIsAccepting,
selectIsSavingFailedIdle,
selectIsSavingFailedInIdle,
} from '../../machines/openIdBle/request';

export function useReceiveVcScreen() {
Expand All @@ -29,7 +29,10 @@ export function useReceiveVcScreen() {
isIncomingVp: useSelector(requestService, selectIsIncomingVp),
isReviewingInIdle: useSelector(requestService, selectIsReviewingInIdle),
isAccepting: useSelector(requestService, selectIsAccepting),
isSavingFailedIdle: useSelector(requestService, selectIsSavingFailedIdle),
IsSavingFailedInIdle: useSelector(
requestService,
selectIsSavingFailedInIdle
),
isVerifyingIdentity: useSelector(requestService, selectIsVerifyingIdentity),
isInvalidIdentity: useSelector(requestService, selectIsInvalidIdentity),

Expand Down
4 changes: 2 additions & 2 deletions shared/hooks/useOverlayVisibleAfterTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export const useOverlayVisibleAfterTimeout = (

useEffect(() => {
if (visibleStart) {
const timeout = setTimeout(() => {
const timeoutID = setTimeout(() => {
setVisible(true);
}, ms);
setSavingTimeout(timeout);
setSavingTimeout(timeoutID);
} else {
clearTimeout(savingTimeout);
setVisible(false);
Expand Down

0 comments on commit 28c5d86

Please sign in to comment.