mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 20:44:02 +00:00
fix(review): harden miniapp auth and finance flows
This commit is contained in:
@@ -107,7 +107,11 @@ function App() {
|
||||
|
||||
try {
|
||||
setDashboard(await fetchMiniAppDashboard(initData))
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (import.meta.env.DEV) {
|
||||
console.warn('Failed to load mini app dashboard', error)
|
||||
}
|
||||
|
||||
setDashboard(null)
|
||||
}
|
||||
} catch {
|
||||
|
||||
@@ -131,14 +131,31 @@ button {
|
||||
background: rgb(247 179 137 / 0.14);
|
||||
}
|
||||
|
||||
.locale-switch__buttons button:focus-visible,
|
||||
.nav-grid button:focus-visible,
|
||||
.ghost-button:focus-visible {
|
||||
outline: 2px solid #f7b389;
|
||||
outline-offset: 2px;
|
||||
border-color: rgb(247 179 137 / 0.7);
|
||||
}
|
||||
|
||||
.hero-card,
|
||||
.panel {
|
||||
border: 1px solid rgb(255 255 255 / 0.1);
|
||||
background-color: rgb(18 26 36 / 0.82);
|
||||
background: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.02));
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
backdrop-filter: blur(16px);
|
||||
box-shadow: 0 24px 64px rgb(0 0 0 / 0.22);
|
||||
}
|
||||
|
||||
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
|
||||
.hero-card,
|
||||
.panel {
|
||||
background: rgb(18 26 36 / 0.94);
|
||||
}
|
||||
}
|
||||
|
||||
.hero-card {
|
||||
margin-top: 28px;
|
||||
border-radius: 28px;
|
||||
|
||||
@@ -77,7 +77,7 @@ export async function fetchMiniAppSession(initData: string): Promise<MiniAppSess
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(payload.error)
|
||||
throw new Error(payload.error ?? 'Failed to create mini app session')
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -23,5 +23,9 @@ declare global {
|
||||
}
|
||||
|
||||
export function getTelegramWebApp(): TelegramWebApp | undefined {
|
||||
if (typeof window === 'undefined') {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return window.Telegram?.WebApp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user