Naprawa błędów awatara

This commit is contained in:
Arek Bykowski
2026-02-15 19:11:08 +01:00
parent 144e28e4c4
commit 9221287d1d
5 changed files with 76 additions and 45 deletions

10
App.tsx
View File

@@ -15,6 +15,10 @@ import { getEnvVar } from './utils/envUtils';
import { AUTHOR_CONFIG } from './_EDITABLE_CONFIG/author';
import { UI_TEXT } from './_EDITABLE_CONFIG/ui_text';
// --- ASSET IMPORT ---
// Importujemy logo bezpośrednio, aby bundler poprawnie rozwiązał ścieżkę
import logoImg from './logo.png';
const STORAGE_KEY = 'gpx-storyteller-state-v6';
const AUTH_KEY = 'promptstory-auth-token';
@@ -131,7 +135,7 @@ const App: React.FC = () => {
const [isLoaded, setIsLoaded] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
// LOGO & AVATAR STATE: Default to false (no error), so we try to show image first.
// LOGO & AVATAR STATE
const [logoError, setLogoError] = useState(false);
const [avatarError, setAvatarError] = useState(false);
@@ -245,10 +249,10 @@ const App: React.FC = () => {
<header className="bg-white sticky top-0 z-10 border-b border-gray-100">
<div className="max-w-4xl mx-auto px-6 py-4 flex justify-between items-center">
<div className="flex items-center space-x-3">
{/* LOGO LOGIC: Try to show image. If error, fallback to icon/text. */}
{/* LOGO LOGIC: Use imported logoImg */}
{!logoError ? (
<img
src="logo.png"
src={logoImg}
alt="Logo"
onError={() => setLogoError(true)}
className="h-10 object-contain"