feat: add telegram mini app (#250)

This commit is contained in:
Dream Hunter
2024-05-19 00:35:10 +08:00
committed by GitHub
parent 46576316e6
commit 870b7b9198
12 changed files with 234 additions and 8 deletions
+4
View File
@@ -68,6 +68,8 @@ export const useGlobalState = createGlobalState(
/** @type {number} */
user_id: 0,
});
const telegramApp = ref(window.Telegram?.WebApp || {});
const isTelegram = ref(!!window.Telegram?.WebApp?.initData);
return {
isDark,
toggleDark,
@@ -95,6 +97,8 @@ export const useGlobalState = createGlobalState(
userSettings,
globalTabplacement,
useSideMargin,
telegramApp,
isTelegram,
}
},
)