chore(release): snapshot 1.4.2
This commit is contained in:
@@ -97,6 +97,32 @@ export function AgencyBranding({ colors }: AgencyBrandingProps) {
|
||||
const cachedLogo = localStorage.getItem('agency-logo-url');
|
||||
if (cachedLogo) {
|
||||
updateFavicon(cachedLogo);
|
||||
} else {
|
||||
// Se não tiver no cache, buscar do backend
|
||||
const fetchAndUpdateFavicon = async () => {
|
||||
const token = localStorage.getItem('token');
|
||||
if (!token) return;
|
||||
|
||||
try {
|
||||
const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080/api';
|
||||
const res = await fetch(`${API_BASE}/agency/profile`, {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
if (data.logo_url) {
|
||||
localStorage.setItem('agency-logo-url', data.logo_url);
|
||||
updateFavicon(data.logo_url);
|
||||
console.log('✅ Favicon carregado do backend:', data.logo_url);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ Erro ao buscar logo para favicon:', error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchAndUpdateFavicon();
|
||||
}
|
||||
|
||||
// Listener para atualizações em tempo real
|
||||
|
||||
Reference in New Issue
Block a user