mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: replace import channels checkbox with LDK-specific warning
The 'I don't have another Alby Hub to migrate or open channels' checkbox on the import recovery phrase screen only applied to LDK but was required for every backend, and its claim that channel funds are always lost is wrong when dynamic channel backups (VSS) are enabled. Remove the checkbox and the channels bullet from the import screen and show the caveat on the Security & Recovery page instead, only when a mnemonic was imported and the LDK backend was chosen. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
14919b4214
commit
bc637a7052
2 changed files with 14 additions and 30 deletions
|
|
@ -1,11 +1,6 @@
|
|||
import * as bip39 from "@scure/bip39";
|
||||
import { wordlist } from "@scure/bip39/wordlists/english.js";
|
||||
import {
|
||||
AlertTriangleIcon,
|
||||
LifeBuoyIcon,
|
||||
ShieldAlertIcon,
|
||||
ShieldCheckIcon,
|
||||
} from "lucide-react";
|
||||
import { AlertTriangleIcon, LifeBuoyIcon, ShieldCheckIcon } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router";
|
||||
|
||||
|
|
@ -14,14 +9,11 @@ import MnemonicInputs from "src/components/mnemonic/MnemonicInputs";
|
|||
import TwoColumnLayoutHeader from "src/components/TwoColumnLayoutHeader";
|
||||
import { Alert, AlertDescription, AlertTitle } from "src/components/ui/alert";
|
||||
import { Button } from "src/components/ui/button";
|
||||
import { Checkbox } from "src/components/ui/checkbox";
|
||||
import { Label } from "src/components/ui/label";
|
||||
import useSetupStore from "src/state/SetupStore";
|
||||
|
||||
export function ImportMnemonic() {
|
||||
const navigate = useNavigate();
|
||||
const setupStore = useSetupStore();
|
||||
const [backedUp, setIsBackedUp] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
// in case the user presses back, remove their last-saved mnemonic
|
||||
|
|
@ -93,32 +85,11 @@ export function ImportMnemonic() {
|
|||
Keep it safe and private to ensure your funds remain secure.
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex gap-2 items-center">
|
||||
<div className="shrink-0 text-muted-foreground">
|
||||
<ShieldAlertIcon className="size-6" />
|
||||
</div>
|
||||
<span className="text-muted-foreground">
|
||||
Your recovery phrase cannot restore funds from lightning channels.
|
||||
If you had active channels on a different device, contact Alby
|
||||
support before proceeding.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</Alert>
|
||||
|
||||
<MnemonicInputs mnemonic={mnemonic} setMnemonic={setMnemonic} />
|
||||
|
||||
<div className="flex items-center mt-5">
|
||||
<Checkbox
|
||||
id="confirmedNoChannels"
|
||||
required
|
||||
onCheckedChange={() => setIsBackedUp(!backedUp)}
|
||||
/>
|
||||
<Label htmlFor="confirmedNoChannels" className="ml-2 cursor-pointer">
|
||||
I don't have another Alby Hub to migrate or open channels (funds from
|
||||
channels will be lost!).
|
||||
</Label>
|
||||
</div>
|
||||
<Button>Next</Button>
|
||||
</form>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,19 @@ export function SetupSecurity() {
|
|||
choose the LDK node type.
|
||||
</span>
|
||||
</div>
|
||||
) : store.hasImportedMnemonic &&
|
||||
store.nodeInfo.backendType === "LDK" ? (
|
||||
<div className="flex gap-3 items-center">
|
||||
<div className="shrink-0">
|
||||
<ShieldAlertIcon className="size-6" />
|
||||
</div>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
Your recovery phrase can only restore funds from lightning
|
||||
channels if you have dynamic channel backups enabled. If you had
|
||||
active channels on a different device, contact Alby support
|
||||
before proceeding.
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex gap-3 items-center">
|
||||
<div className="shrink-0">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue