diff options
Diffstat (limited to 'packages/challenger-ui/src/hooks/session.ts')
-rw-r--r-- | packages/challenger-ui/src/hooks/session.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/challenger-ui/src/hooks/session.ts b/packages/challenger-ui/src/hooks/session.ts index 54eeb2fdc..4dc7e0dc1 100644 --- a/packages/challenger-ui/src/hooks/session.ts +++ b/packages/challenger-ui/src/hooks/session.ts @@ -41,7 +41,9 @@ export type SessionId = { }; export type LastChallengeResponse = { - attemptsLeft: number; + sendCodeLeft: number; + changeTargetLeft: number; + checkPinLeft: number; nextSend: AbsoluteTime; transmitted: boolean; }; @@ -53,7 +55,9 @@ export type SessionState = SessionId & { }; export const codecForLastChallengeResponse = (): Codec<LastChallengeResponse> => buildCodecForObject<LastChallengeResponse>() - .property("attemptsLeft", codecForNumber()) + .property("sendCodeLeft", codecForNumber()) + .property("changeTargetLeft", codecForNumber()) + .property("checkPinLeft", codecForNumber()) .property("nextSend", codecForAbsoluteTime) .property("transmitted", codecForBoolean()) .build("LastChallengeResponse"); @@ -127,7 +131,8 @@ export function useSessionState(): SessionStateHandler { const ls = state.lastStatus; if ( ls.changes_left !== st.changes_left || - ls.fix_address !== st.fix_address || ls.last_address !== st.last_address + ls.fix_address !== st.fix_address || + ls.last_address !== st.last_address ) { update({ ...state, |