From ff42d99624c4bff56f12428db80d417e088ec0da Mon Sep 17 00:00:00 2001 From: Francis O'Brien <42175565+F-OBrien@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:48:38 +0000 Subject: [PATCH] fix: set chainSpecific account type and disable Ethereum switch (#1608) --- packages/extension-ui/src/Popup/ImportLedger.tsx | 8 ++++++++ packages/extension-ui/src/components/Switch.tsx | 14 ++++++++++++-- packages/extension-ui/src/hooks/useLedger.ts | 5 ++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/extension-ui/src/Popup/ImportLedger.tsx b/packages/extension-ui/src/Popup/ImportLedger.tsx index 324a6045..f5057987 100644 --- a/packages/extension-ui/src/Popup/ImportLedger.tsx +++ b/packages/extension-ui/src/Popup/ImportLedger.tsx @@ -42,6 +42,7 @@ function ImportLedger ({ className }: Props): React.ReactElement { const [isEthereum, setIsEthereum] = useState(false); const onAction = useContext(ActionContext); const [name, setName] = useState(null); + const isChainSpecific = settings.ledgerApp === 'chainSpecific'; const { address, error: ledgerError, isLoading: ledgerLoading, isLocked: ledgerLocked, refresh, type, warning: ledgerWarning } = useLedger(genesis, accountIndex, addressOffset, isEthereum); useEffect(() => { @@ -50,6 +51,12 @@ function ImportLedger ({ className }: Props): React.ReactElement { } }, [address]); + useEffect(() => { + if (isChainSpecific) { + setIsEthereum(false); + } + }, [isChainSpecific]); + const accOps = useRef(AVAIL.map((value): AccOption => ({ text: t('Account type {{index}}', { replace: { index: value } }), value @@ -112,6 +119,7 @@ function ImportLedger ({ className }: Props): React.ReactElement { diff --git a/packages/extension-ui/src/components/Switch.tsx b/packages/extension-ui/src/components/Switch.tsx index 5ec18707..14a45572 100644 --- a/packages/extension-ui/src/components/Switch.tsx +++ b/packages/extension-ui/src/components/Switch.tsx @@ -11,21 +11,23 @@ interface Props { uncheckedLabel: string; checkedLabel: string; className?: string; + isDisabled?: boolean; } -function Switch ({ checked, checkedLabel, className, onChange, uncheckedLabel }: Props): React.ReactElement { +function Switch ({ checked, checkedLabel, className, isDisabled, onChange, uncheckedLabel }: Props): React.ReactElement { const _onChange = useCallback( (event: React.ChangeEvent) => onChange(event.target.checked), [onChange] ); return ( -
+
{uncheckedLabel}