debug: add retry auth button and increase wait time to 5s

This commit is contained in:
2026-02-07 05:40:20 +03:00
parent 5382579f9f
commit 4674e06251
5 changed files with 42 additions and 12 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ interface AuthContextType {
const AuthContext = createContext<AuthContextType | null>(null);
// Wait for Telegram SDK to be ready with initData
function waitForInitData(maxAttempts = 10, intervalMs = 200): Promise<string | null> {
// 25 attempts * 200ms = 5 seconds max wait
function waitForInitData(maxAttempts = 25, intervalMs = 200): Promise<string | null> {
return new Promise((resolve) => {
let attempts = 0;
+17 -1
View File
@@ -14,7 +14,14 @@ import { useAuth } from '@/contexts/AuthContext';
export function AnnouncementsSection() {
const { hapticImpact, hapticNotification, openLink } = useTelegram();
const { isAuthenticated, sessionToken, user, authError } = useAuth();
const {
isAuthenticated,
sessionToken,
user,
authError,
signIn,
isLoading: authLoading,
} = useAuth();
const { data: announcements, isLoading, refetch, isRefetching } = useAnnouncements();
const reactionMutation = useAnnouncementReaction(sessionToken);
@@ -91,6 +98,15 @@ export function AnnouncementsSection() {
Platform: {window.Telegram?.WebApp?.platform || 'unknown'} | Ver:{' '}
{window.Telegram?.WebApp?.version || '?'}
</div>
{!isAuthenticated && (
<button
onClick={() => signIn()}
disabled={authLoading}
className="mt-2 px-3 py-1 bg-yellow-500 text-black rounded text-xs font-medium"
>
{authLoading ? 'Deneniyor...' : 'Retry Auth'}
</button>
)}
</div>
{/* Content */}
+3 -3
View File
@@ -1,5 +1,5 @@
{
"version": "1.0.148",
"buildTime": "2026-02-07T02:35:20.304Z",
"buildNumber": 1770431720305
"version": "1.0.149",
"buildTime": "2026-02-07T02:40:20.478Z",
"buildNumber": 1770432020479
}