Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes app unresponsive on tapsigner unlock #5977

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 33 additions & 25 deletions src/screens/SignTransaction/SignTransactionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function SignTransactionScreen() {
};
}, []);

const { withModal, nfcVisible: TSNfcVisible } = useTapsignerModal(card);
const { withModal, nfcVisible: TSNfcVisible, closeNfc: closeTSNfc } = useTapsignerModal(card);
const { withNfcModal, nfcVisible, closeNfc } = useNfcModal();
const { inheritanceSigningRequestId } = useAppSelector((state) => state.sendAndReceive);

Expand Down Expand Up @@ -341,29 +341,34 @@ function SignTransactionScreen() {
const copySerializedPSBTEnvelop = cloneDeep(serializedPSBTEnvelop);
const { signerType, serializedPSBT, signingPayload, xfp } = copySerializedPSBTEnvelop;
if (SignerType.TAPSIGNER === signerType) {
const { signingPayload: signedPayload, signedSerializedPSBT } =
await signTransactionWithTapsigner({
setTapsignerModal,
signingPayload,
currentKey,
withModal,
defaultVault,
serializedPSBT,
card,
cvc: tapsignerCVC,
signer,
});
dispatch(
updatePSBTEnvelops({ signedSerializedPSBT, xfp, signingPayload: signedPayload })
);
dispatch(
healthCheckStatusUpdate([
{
signerId: signer.masterFingerprint,
status: hcStatusType.HEALTH_CHECK_SIGNING,
},
])
);
try {
const { signingPayload: signedPayload, signedSerializedPSBT } =
await signTransactionWithTapsigner({
setTapsignerModal,
signingPayload,
currentKey,
withModal,
defaultVault,
serializedPSBT,
card,
cvc: tapsignerCVC,
signer,
});
dispatch(
updatePSBTEnvelops({ signedSerializedPSBT, xfp, signingPayload: signedPayload })
);
dispatch(
healthCheckStatusUpdate([
{
signerId: signer.masterFingerprint,
status: hcStatusType.HEALTH_CHECK_SIGNING,
},
])
);
} catch (error) {
closeTSNfc();
throw error;
}
} else if (SignerType.COLDCARD === signerType) {
await signTransactionWithColdCard({
setColdCardModal,
Expand Down Expand Up @@ -842,7 +847,10 @@ function SignTransactionScreen() {
isRemoteKey={false}
isMiniscript={!!defaultVault?.scheme?.miniscriptScheme}
/>
<NfcPrompt visible={nfcVisible || TSNfcVisible} close={closeNfc} />
<NfcPrompt
visible={nfcVisible || TSNfcVisible}
close={() => (TSNfcVisible ? closeTSNfc() : closeNfc())}
/>
<KeeperModal
visible={visibleModal}
close={() => {
Expand Down
Loading