Skip to content

Commit

Permalink
feat(ui): enable direct telegram opening for all wallets in telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
thekiba committed Aug 14, 2024
1 parent d528f9c commit 3855145
Showing 1 changed file with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ConnectAdditionalRequest,
isTelegramUrl,
isWalletInfoCurrentlyInjected,
WalletInfoInjectable,
WalletInfoRemote
Expand Down Expand Up @@ -124,23 +125,27 @@ export const DesktopConnectionModal: Component<DesktopConnectionProps> = props =

setMode('desktop');

const forceRedirect = !firstClick();
setFirstClick(false);
if (isTelegramUrl(universalLink())) {
onClickTelegram();
} else {
const forceRedirect = !firstClick();
setFirstClick(false);

redirectToWallet(
universalLink()!,
props.wallet.deepLink,
{
returnStrategy: appState.returnStrategy,
forceRedirect: forceRedirect
},
(method: 'universal-link' | 'custom-deeplink'): void => {
setLastSelectedWalletInfo({
...props.wallet,
openMethod: method
});
}
);
redirectToWallet(
universalLink()!,
props.wallet.deepLink,
{
returnStrategy: appState.returnStrategy,
forceRedirect: forceRedirect
},
(method: 'universal-link' | 'custom-deeplink'): void => {
setLastSelectedWalletInfo({
...props.wallet,
openMethod: method
});
}
);
}
};

const onClickTelegram = (): void => {
Expand Down

0 comments on commit 3855145

Please sign in to comment.