fix: fallback defensivo para logo e sincronizacao de abas do dashboard dev
This commit is contained in:
@@ -24,6 +24,7 @@ export const DeveloperDashboard: React.FC = () => {
|
|||||||
const [appName, setAppName] = useState('');
|
const [appName, setAppName] = useState('');
|
||||||
const [appSubtitle, setAppSubtitle] = useState('');
|
const [appSubtitle, setAppSubtitle] = useState('');
|
||||||
const [logoUrl, setLogoUrl] = useState('');
|
const [logoUrl, setLogoUrl] = useState('');
|
||||||
|
const [logoError, setLogoError] = useState(false);
|
||||||
const [isSaving, setIsSaving] = useState(false);
|
const [isSaving, setIsSaving] = useState(false);
|
||||||
const [isUploading, setIsUploading] = useState(false);
|
const [isUploading, setIsUploading] = useState(false);
|
||||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||||
@@ -69,6 +70,7 @@ export const DeveloperDashboard: React.FC = () => {
|
|||||||
setAppName(settings.appName);
|
setAppName(settings.appName);
|
||||||
setAppSubtitle(settings.appSubtitle);
|
setAppSubtitle(settings.appSubtitle);
|
||||||
setLogoUrl(settings.appLogoUrl || '');
|
setLogoUrl(settings.appLogoUrl || '');
|
||||||
|
setLogoError(false);
|
||||||
}
|
}
|
||||||
}, [settings]);
|
}, [settings]);
|
||||||
|
|
||||||
@@ -298,8 +300,8 @@ export const DeveloperDashboard: React.FC = () => {
|
|||||||
<span className="text-xs font-bold text-text-muted uppercase tracking-wider mb-2 block">Preview</span>
|
<span className="text-xs font-bold text-text-muted uppercase tracking-wider mb-2 block">Preview</span>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shrink-0 overflow-hidden shadow-lg">
|
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shrink-0 overflow-hidden shadow-lg">
|
||||||
{logoUrl ? (
|
{logoUrl && !logoError ? (
|
||||||
<img src={logoUrl} alt="Preview" className="w-full h-full object-cover" />
|
<img src={logoUrl} alt="Preview" onError={() => setLogoError(true)} className="w-full h-full object-cover" />
|
||||||
) : (
|
) : (
|
||||||
<span className="text-white font-black text-xl">{appName?.[0] || 'G'}</span>
|
<span className="text-white font-black text-xl">{appName?.[0] || 'G'}</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user