From 2bf9461f879d4ebc8161b8176998cea3fccac6a9 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 19 Nov 2021 12:47:55 +0100 Subject: [PATCH] do not ask for confirmation during recovery --- .../src/pages/home/AttributeEntryScreen.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx index 1b50779e0..c3c5d764b 100644 --- a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx @@ -19,6 +19,7 @@ export function AttributeEntryScreen(): VNode { const [attrs, setAttrs] = useState>( currentIdentityAttributes, ); + const isBackup = state && state.backup_state; const [askUserIfSure, setAskUserIfSure] = useState(false); if (!reducer) { @@ -54,11 +55,17 @@ export function AttributeEntryScreen(): VNode { ); }); + const doConfirm = async () => { + await reducer.transition("enter_user_attributes", { + identity_attributes: attrs, + }); + }; + return ( setAskUserIfSure(true) } + onNext={async () => isBackup ? setAskUserIfSure(true) : doConfirm() } > {askUserIfSure ? ( reducer.transition("enter_user_attributes", { - identity_attributes: attrs, - }).then(() => setAskUserIfSure(false) )} + onConfirm={() => doConfirm().then(() => setAskUserIfSure(false) )} > You personal information is used to define the location where your secret will be safely stored. If you forget what you have entered or