debug: add visible auth debug banner

This commit is contained in:
2026-02-07 03:37:25 +03:00
parent 760db703c5
commit d000ba78db
3 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pezkuwi-telegram-miniapp",
"version": "1.0.139",
"version": "1.0.141",
"type": "module",
"description": "Pezkuwichain Telegram Mini App - Forum, Announcements, Rewards",
"author": "Pezkuwichain Team",
+15 -1
View File
@@ -14,11 +14,19 @@ import { useAuth } from '@/contexts/AuthContext';
export function AnnouncementsSection() {
const { hapticImpact, hapticNotification, openLink } = useTelegram();
const { isAuthenticated, sessionToken } = useAuth();
const { isAuthenticated, sessionToken, user, authError } = useAuth();
const { data: announcements, isLoading, refetch, isRefetching } = useAnnouncements();
const reactionMutation = useAnnouncementReaction(sessionToken);
// Debug: Log auth state
console.log('[Announcements] Auth state:', {
isAuthenticated,
hasSessionToken: !!sessionToken,
user: user?.first_name,
authError,
});
const handleReaction = (id: string, reaction: 'like' | 'dislike') => {
if (!isAuthenticated) {
hapticNotification('error');
@@ -66,6 +74,12 @@ export function AnnouncementsSection() {
</div>
</header>
{/* Debug Banner - Remove after fixing */}
<div className="bg-yellow-500/20 text-yellow-300 text-xs p-2 mx-4 mt-2 rounded">
Auth: {isAuthenticated ? 'YES' : 'NO'} | Token: {sessionToken ? 'YES' : 'NO'} | User:{' '}
{user?.first_name || 'null'} | Error: {authError || 'none'}
</div>
{/* Content */}
<div className="flex-1 overflow-y-auto hide-scrollbar">
{isLoading ? (
+3 -3
View File
@@ -1,5 +1,5 @@
{
"version": "1.0.139",
"buildTime": "2026-02-07T00:36:05.724Z",
"buildNumber": 1770424565725
"version": "1.0.141",
"buildTime": "2026-02-07T00:37:25.080Z",
"buildNumber": 1770424645081
}