Skip to content

Commit

Permalink
fix: back home isssue
Browse files Browse the repository at this point in the history
  • Loading branch information
AMIRKHANEF committed Nov 26, 2024
1 parent d94ffbc commit 83331b0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/extension-polkagate/src/popup/metadata/Request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ export default function Request ({ metaId, request, url }: Props): React.ReactEl
const chain = useMetadata(request.genesisHash, true);
const onAction = useContext(ActionContext);

const _onApprove = useCallback(
const onApprove = useCallback(
(): void => {
approveMetaRequest(metaId)
.then(() => onAction())
.then(() => onAction('/'))
.catch(console.error);
},
[metaId, onAction]
);

const _onReject = useCallback(
const onReject = useCallback(
(): void => {
rejectMetaRequest(metaId)
.then(() => onAction())
.then(() => onAction('/'))
.catch(console.error);
},
[metaId, onAction]
Expand Down Expand Up @@ -111,8 +111,8 @@ export default function Request ({ metaId, request, url }: Props): React.ReactEl
</Warning>
</Grid>
<TwoButtons
onPrimaryClick={_onApprove}
onSecondaryClick={_onReject}
onPrimaryClick={onApprove}
onSecondaryClick={onReject}
primaryBtnText={t('Approve')}
secondaryBtnText={t('Reject')}
variant='text'
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-polkagate/src/popup/metadata/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function Metadata (): React.ReactElement {
const onReject = useCallback(
(): void => {
rejectMetaRequest(requests[0].id)
.then(() => onAction())
.then(() => onAction('/'))
.catch(console.error);
},
[onAction, requests]
Expand All @@ -26,7 +26,7 @@ export default function Metadata (): React.ReactElement {
<>
<Header
onClose={onReject}
text={t<string>('Metadata')}
text={t('Metadata')}
/>
{requests[0]
? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function SignArea({ buttonText, error, isExternal, isFirst, isSig
approveSignPassword(signId, savePass, password)
.then((): void => {
setIsBusy(false);
onAction();
onAction('/');
})
.catch((error: Error): void => {
setIsBusy(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function Request ({ account: { accountIndex, addressOffset, isExt
const _onSignature = useCallback(
({ signature }: { signature: HexString }): void => {
approveSignSignature(signId, signature)
.then(() => onAction())
.then(() => onAction('/'))
.catch((error: Error): void => {
setError(error.message);
console.error(error);
Expand All @@ -101,7 +101,7 @@ export default function Request ({ account: { accountIndex, addressOffset, isExt
extrinsic.addSignature(_address, signature, _raw.toHex());

approveSignSignature(signId, signature, extrinsic.toHex())
.then(() => onAction())
.then(() => onAction('/'))
.catch((error: Error): void => {
setError(error.message);
console.error(error);
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-polkagate/src/popup/signing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Signing (): React.ReactElement {
}

cancelSignRequest(request.id)
.then(() => onAction())
.then(() => onAction('/'))
.catch((error: Error) => console.error(error));
}, [onAction, request?.id]);

Expand Down

0 comments on commit 83331b0

Please sign in to comment.