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

fix(bridge-ui): enable continue button for scanned nft imports #16070

Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { t } from 'svelte-i18n';

import { enteredAmount, selectedNFTs } from '$components/Bridge/state';
Expand Down Expand Up @@ -41,6 +40,7 @@
};

function onManualImportClick() {
$selectedNFTs = [];
$selectedImportMethod = ImportMethod.MANUAL;
}
$: isERC1155 = $selectedNFTs ? $selectedNFTs.some((nft) => nft.type === 'ERC1155') : false;
Expand All @@ -61,10 +61,6 @@
} else {
canProceed = false;
}

onDestroy(() => {
$selectedNFTs = [];
});
</script>

<div class="f-col w-full gap-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { t } from 'svelte-i18n';

import { importDone } from '$components/Bridge/state';
import { selectedNFTs } from '$components/Bridge/state';
import { BridgeSteps, BridgingStatus, ImportMethod } from '$components/Bridge/types';
import { ActionButton } from '$components/Button';

Expand Down Expand Up @@ -39,7 +39,10 @@
};

const handlePreviousStep = () => {
if (activeStep === BridgeSteps.REVIEW) {
if (activeStep === BridgeSteps.IMPORT) {
$selectedNFTs = [];
$selectedImportMethod = ImportMethod.NONE;
} else if (activeStep === BridgeSteps.REVIEW) {
activeStep = BridgeSteps.IMPORT;
} else if (activeStep === BridgeSteps.CONFIRM) {
activeStep = BridgeSteps.REVIEW;
Expand All @@ -59,13 +62,15 @@
{#if $selectedImportMethod !== ImportMethod.NONE}
<ActionButton
priority="primary"
disabled={!$importDone}
disabled={!$selectedNFTs || $selectedNFTs.length === 0}
loading={validatingImport}
on:click={() => handleNextStep()}>
<span class="body-bold">{nextStepButtonText}</span>
</ActionButton>

<StepBack on:click={() => ($selectedImportMethod = ImportMethod.NONE)}>{$t('common.back')}</StepBack>
<StepBack on:click={() => handlePreviousStep()}>
{$t('common.back')}
</StepBack>
{/if}
{/if}
{#if activeStep === BridgeSteps.REVIEW}
Expand Down