From a8560b7cbb1097614b83144f76300cc1fe7f8930 Mon Sep 17 00:00:00 2001 From: tay suisin Date: Thu, 20 Oct 2022 16:00:14 +0800 Subject: [PATCH] Update logic for handle manual --- .../app/pages/user/account/authenticate.js | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/javascript/app/pages/user/account/authenticate.js b/src/javascript/app/pages/user/account/authenticate.js index 6474d79efd0b5..a77ade14e74a4 100644 --- a/src/javascript/app/pages/user/account/authenticate.js +++ b/src/javascript/app/pages/user/account/authenticate.js @@ -1438,13 +1438,31 @@ const Authenticate = (() => { } }; - const handleManual = () => { - $('#idv-container').setVisibility(0); - $('#authentication_tab').setVisibility(1); - $('#msg_personal_details').setVisibility(1); - TabSelector.updateTabDisplay(); - $('#not_authenticated_uns').setVisibility(1); - initUnsupported(); + const handleManual = async () => { + account_status = await getAccountStatus(); + const { manual } = account_status.authentication.identity.services; + const { status } = manual; + switch (status){ + case 'none': + $('#idv-container').setVisibility(0); + $('#authentication_tab').setVisibility(1); + $('#msg_personal_details').setVisibility(1); + TabSelector.updateTabDisplay(); + $('#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 () => {