Merge pull request #640 from Fr1ngg/revert-639-bedolaga/remove-happ_cryptolink_redirect_template-binding

Revert "Open HAPP cryptolink from miniapp externally"
This commit is contained in:
Egor
2025-10-01 05:41:48 +03:00
committed by GitHub

View File

@@ -2519,20 +2519,6 @@
updateActionButtons();
}
function openLink(link, { external = false } = {}) {
if (!link) {
return;
}
if (external && typeof tg.openLink === 'function') {
tg.openLink(link, { try_instant_view: false });
return;
}
const target = external ? '_blank' : '_self';
window.open(link, target, 'noopener,noreferrer');
}
document.querySelectorAll('.platform-btn').forEach(btn => {
btn.addEventListener('click', () => {
currentPlatform = btn.dataset.platform;
@@ -2544,16 +2530,9 @@
document.getElementById('connectBtn')?.addEventListener('click', () => {
const link = getConnectLink();
if (!link) {
return;
if (link) {
window.location.href = link;
}
const shouldOpenExternally = Boolean(
userData?.happ_cryptolink_redirect_link &&
link === userData.happ_cryptolink_redirect_link
);
openLink(link, { external: shouldOpenExternally });
});
document.getElementById('copyBtn')?.addEventListener('click', async () => {