Skip to content
Merged
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
11 changes: 9 additions & 2 deletions packages/shared/routes/setup/import/views/FileImport.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
let fileName
let filePath

// TODO: remove this to enable seed support
$: isSeedVault = fileName && fileName.endsWith('.kdbx')

const dispatch = createEventDispatcher()

function handleContinueClick() {
Expand Down Expand Up @@ -42,10 +45,14 @@
{onDrop}
{locale}
extentionsLabel={locale('actions.importExtentions')}
allowedExtensions={["kdbx", "stronghold"]} />
allowedExtensions={['kdbx', 'stronghold']} />
{#if isSeedVault}
<!-- TODO: remove this when enabling seed support -->
<Text type="p" error secondary classes="mt-4">Seed Vaults are not currently supported.</Text>
{/if}
</div>
<div slot="leftpane__action" class="flex flex-row flex-wrap justify-between items-center space-x-4">
<Button classes="flex-1" disabled={!file} onClick={() => handleContinueClick()}>{locale('actions.continue')}</Button>
<Button classes="flex-1" disabled={!file || isSeedVault} onClick={() => handleContinueClick()}>{locale('actions.continue')}</Button>
</div>
<div slot="rightpane" class="w-full h-full flex justify-center p-16" style="background-color: #FFF8EF">
<Illustration illustration="import-from-file-desktop" width="auto" height="auto" />
Expand Down
10 changes: 9 additions & 1 deletion packages/shared/routes/setup/import/views/TextImport.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
export let mobile

let input = ''
let isSeed = false

// TODO: remove this to enable seed support
$: isSeed = input.length === 81

const dispatch = createEventDispatcher()

Expand All @@ -26,9 +30,13 @@
<Text type="p" secondary classes="mb-8">{locale('views.importFromText.body2')}</Text>
<Text type="h5" classes="mb-4">{locale('views.importFromText.body3')}</Text>
<ImportTextfield bind:value={input} {locale} />
{#if isSeed}
<!-- TODO: remove this when enabling seed support -->
<Text type="p" error secondary classes="mt-4">Seeds are not currently supported.</Text>
{/if}
</div>
<div slot="leftpane__action" class="flex flex-row flex-wrap justify-between items-center space-x-4">
<Button classes="flex-1" disabled={input.length === 0} onClick={() => handleContinueClick()}>
<Button classes="flex-1" disabled={input.length === 0 || isSeed} onClick={() => handleContinueClick()}>
{locale('actions.continue')}
</Button>
</div>
Expand Down