Skip to content

Commit

Permalink
Add support for Android chromium-webview [BUG] issue issue #414
Browse files Browse the repository at this point in the history
  • Loading branch information
skcross committed Jul 30, 2024
1 parent 31f6a17 commit 4b0d0be
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions packages/connectkit/src/components/Common/ConnectorList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ const ConnectorList = () => {
context.options?.hideRecentBadge || lastConnectorId === 'walletConnect' // do not hoist walletconnect to top of list
? wallets
: [
// move last used wallet to top of list
// using .filter and spread to avoid mutating original array order with .sort
...wallets.filter(
(wallet) => lastConnectorId === wallet.connector.id
),
...wallets.filter(
(wallet) => lastConnectorId !== wallet.connector.id
),
];
// move last used wallet to top of list
// using .filter and spread to avoid mutating original array order with .sort
...wallets.filter(
(wallet) => lastConnectorId === wallet.connector.id
),
...wallets.filter(
(wallet) => lastConnectorId !== wallet.connector.id
),
];

return (
<ScrollArea mobileDirection={'horizontal'}>
Expand Down Expand Up @@ -97,7 +97,7 @@ const ConnectorItem = ({

let deeplink =
(!wallet.isInstalled && isMobile) ||
(wallet.shouldDeeplinkDesktop && !isMobile)
(wallet.shouldDeeplinkDesktop && !isMobile)
? wallet.getWalletConnectDeeplink?.(uri ?? '')
: undefined;

Expand All @@ -114,21 +114,22 @@ const ConnectorItem = ({
type="button"
as={deeplink ? 'a' : undefined}
href={deeplink ? deeplink : undefined}
target={deeplink && detectBrowser() === 'chromium-webview' ? '_blank' : undefined}
disabled={context.route !== routes.CONNECTORS}
onClick={
deeplink
? undefined
: () => {
if (redirectToMoreWallets) {
context.setRoute(routes.MOBILECONNECTORS);
} else {
if (shouldConnectImmediately) {
connect({ connector: wallet?.connector });
}
context.setRoute(routes.CONNECT);
context.setConnector({ id: wallet.id });
if (redirectToMoreWallets) {
context.setRoute(routes.MOBILECONNECTORS);
} else {
if (shouldConnectImmediately) {
connect({ connector: wallet?.connector });
}
context.setRoute(routes.CONNECT);
context.setConnector({ id: wallet.id });
}
}
}
>
<ConnectorIcon
Expand Down

0 comments on commit 4b0d0be

Please sign in to comment.