diff --git a/web/src/context/AppContext.tsx b/web/src/context/AppContext.tsx index 2ffbcf5..66a7183 100644 --- a/web/src/context/AppContext.tsx +++ b/web/src/context/AppContext.tsx @@ -184,7 +184,14 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => { rating: 0 } ]).then(({ error }) => { - if (error) console.error("Erro ao sincronizar shop nova na BD:", error); + if (error) { + // Ignora o erro de duplicado (shop já existe na BD) + if (error.code !== '23505') { + console.error("Erro ao sincronizar shop nova na BD:", error); + } + } + // Recarrega shops da BD para garantir que a nova shop aparece corretamente + void refreshShops(); }); } } diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index e6aca82..f9f090a 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -91,6 +91,9 @@ export default function Dashboard() { } = useApp(); const shop = shops.find((s) => s.id === user?.shopId); + + + const [activeTab, setActiveTab] = useState('overview'); const [period, setPeriod] = useState('semana'); const [appointmentView, setAppointmentView] = useState<'list' | 'calendar'>('list');