Skip to content

Commit

Permalink
Suisin/Changes on authenticate.js to show Manual Upload after Onfido …
Browse files Browse the repository at this point in the history
…fail 3 … (binary-com#7269)

* Changes on authenticate.js to show Manual Upload after Onfido fail 3 times

* Update logic for handle manual

* Fix: Displaying Pending Message when websocket network message is in pending

---------

Co-authored-by: Matin shafiei <[email protected]>
  • Loading branch information
suisin-deriv and matin-deriv authored Jan 30, 2023
1 parent ef449b2 commit cd9ec06
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/javascript/app/pages/user/account/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ const Authenticate = (() => {
case 'suspected':
case 'rejected':
if (Number(submissions_left) < 1) {
$('#limited_poi').setVisibility(1);
handleManual();
} else {
const maximum_reasons = rejected_reasons.slice(0, 3);
const has_minimum_reasons = rejected_reasons.length > 3;
Expand Down Expand Up @@ -1440,13 +1440,32 @@ const Authenticate = (() => {
}
};

const handleManual = () => {
$('#idv-container').setVisibility(0);
const handleManual = async () => {
account_status = await getAccountStatus();
const { manual } = account_status.authentication.identity.services;
const { status } = manual;
$('#authentication_tab').setVisibility(1);
$('#msg_personal_details').setVisibility(1);
TabSelector.updateTabDisplay();
$('#not_authenticated_uns').setVisibility(1);
initUnsupported();

switch (status){
case 'none':
$('#idv-container').setVisibility(0);
$('#msg_personal_details').setVisibility(1);
$('#not_authenticated_uns').setVisibility(1);
initUnsupported();
break;
case 'pending':
$('#idv-container').setVisibility(0);
$('#upload_complete').setVisibility(1);
break;
case 'rejected':
case 'suspected':
$('#idv-container').setVisibility(0);
$('#limited_poi').setVisibility(1);
break;
default:
break;
}
};

const initAuthentication = async () => {
Expand Down

0 comments on commit cd9ec06

Please sign in to comment.