Skip to content

Cannot open telegram link after switch account #41

@dr4kedk

Description

@dr4kedk

Describe the bug
I'm trying to build mini app where user can access interesting channel, group ...
For the first time user start telegram, they click on the button "Open" contain telegram link. It will open perfectly. But when user switch to another account and start mini app, click open button, it not go to channel/chat
If user want to open link inside mini app, they have to quit telegram and then start telegram again

Code i'm using to open telegram link

import WebApp from "@twa-dev/sdk";

export const openTelegramLink = (link: string) => {
try {
if (typeof window !== "undefined") {
WebApp.openTelegramLink(link)
}
} catch (error) {
console. log (error);

Telegram link sample: https://t.me/tapps_bot

Steps to reproduce
Step 1: Create simple mini app, add button "Open" open telegram link when click. Sample: https://t.me/tapps_bot, link of Telegram Apps Center bot
Step 2: Start Telegram with Account A, open mini app and click button "Open", it will redirect to chat with Telegram Apps Center
Step 3: Close mini app, switch to Account B, open mini app, click button "Open", it still good
Step 4: Close mini app, switch to Account A, open mini app, click button "Open", now nothing happen, some time miniapp has disappear
Step 5: Quit telegram, start again so it will be open link perfectly from step 1

Expected behavior
I expected user still go to chat with Telegram Apps Center, still can open link after switch account many times

How often does this bug happen?
Always when following these steps

Platform
OS: MacOS Monterey 12.7.6
Chrome: Version 130.0.6723.117 (Official Build) (x86_64)
NextJs: 14.2.13

Package Version
@twa-dev/sdk": "^8.0.1"
"typescript":"^5"
"nextjs":14.2.13
"react":"^18"

Metadata

Metadata

Assignees

No one assigned

    Labels

    TG IssueIssue that is related rather to Telegram than to this library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions