Skip to content

Commit

Permalink
chore: can only reject when high risks occur
Browse files Browse the repository at this point in the history
  • Loading branch information
slient-coder authored and jiedo committed Dec 29, 2023
1 parent 8abdef0 commit 02854b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
26 changes: 17 additions & 9 deletions src/ui/pages/Approval/components/SignPsbt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,14 @@ export default function SignPsbt({
return val;
}, [txInfo.decodedPsbt]);

const hasHighRisk = useMemo(() => {
if (txInfo && txInfo.decodedPsbt) {
return txInfo.decodedPsbt.risks.find((v) => v.level === 'high') ? true : false;
} else {
return false;
}
}, [txInfo]);

if (loading) {
return (
<Layout>
Expand Down Expand Up @@ -700,7 +708,6 @@ export default function SignPsbt({

{atomicals_ft.length > 0 && (
<Row>
(
<Column justifyCenter>
<Text text={`ARC20`} color={isToSign ? 'white' : 'textDim'} />
<Row overflowX gap="lg" style={{ width: 280 }} pb="lg">
Expand All @@ -709,7 +716,6 @@ export default function SignPsbt({
))}
</Row>
</Column>
)
</Row>
)}
</Column>
Expand Down Expand Up @@ -829,13 +835,15 @@ export default function SignPsbt({
<Footer>
<Row full>
<Button preset="default" text="Reject" onClick={handleCancel} full />
<Button
preset="primary"
text={type == TxType.SIGN_TX ? 'Sign' : 'Sign & Pay'}
onClick={handleConfirm}
disabled={isValid == false}
full
/>
{hasHighRisk == false && (
<Button
preset="primary"
text={type == TxType.SIGN_TX ? 'Sign' : 'Sign & Pay'}
onClick={handleConfirm}
disabled={isValid == false}
full
/>
)}
</Row>
</Footer>
{isWarningVisible && (
Expand Down
1 change: 0 additions & 1 deletion src/ui/pages/BRC20/BRC20TokenScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default function BRC20TokenScreen() {

const shouldShowSafe = tokenSummary.tokenBalance.availableBalanceSafe !== tokenSummary.tokenBalance.availableBalance;
const unisatWebsite = useUnisatWebsite();
console.log(ticker);
return (
<Layout>
<Header
Expand Down

0 comments on commit 02854b8

Please sign in to comment.