diff --git a/index.html b/index.html index 37ae5b6..36fccef 100644 --- a/index.html +++ b/index.html @@ -5,9 +5,7 @@ - - - + FoodSnap.ai - Nutricionista de Bolso com InteligĂȘncia Artificial diff --git a/public/pwa-192x192.png b/public/pwa-192x192.png deleted file mode 100644 index d9acf0b..0000000 Binary files a/public/pwa-192x192.png and /dev/null differ diff --git a/public/pwa-512x512.png b/public/pwa-512x512.png deleted file mode 100644 index d9acf0b..0000000 Binary files a/public/pwa-512x512.png and /dev/null differ diff --git a/src/contexts/UserContext.tsx b/src/contexts/UserContext.tsx index 2f12920..f54d63e 100644 --- a/src/contexts/UserContext.tsx +++ b/src/contexts/UserContext.tsx @@ -80,6 +80,8 @@ export const UserProvider: React.FC<{ children: ReactNode }> = ({ children }) => } catch (error) { console.error('UserContext: Erro ao carregar perfil', error); setUser(null); + } finally { + setLoading(false); } }; diff --git a/vite.config.ts b/vite.config.ts index 135a481..f1abd1f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,6 @@ import path from 'path'; import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; -import { VitePWA } from 'vite-plugin-pwa'; export default defineConfig(({ mode }) => { const env = loadEnv(mode, '.', ''); @@ -10,51 +9,7 @@ export default defineConfig(({ mode }) => { port: 3000, host: '0.0.0.0', }, - plugins: [ - react(), - VitePWA({ - registerType: 'autoUpdate', - injectRegister: 'auto', // Re-enable SW for installation criteria - includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'], - manifest: { - name: 'FoodSnap.ai', - short_name: 'FoodSnap', - description: 'Nutricionista de Bolso com InteligĂȘncia Artificial', - theme_color: '#059669', - background_color: '#ffffff', - display: 'standalone', - orientation: 'portrait', - icons: [ - { - src: 'pwa-192x192.png', - sizes: '192x192', - type: 'image/png' - }, - { - src: 'pwa-512x512.png', - sizes: '512x512', - type: 'image/png' - }, - { - src: 'pwa-512x512.png', - sizes: '512x512', - type: 'image/png', - purpose: 'any maskable' - } - ] - }, - workbox: { - // NetworkOnly strategy to prevent caching issues/lag but allow installation - runtimeCaching: [{ - urlPattern: ({ request }) => request.destination === 'document' || request.destination === 'script' || request.destination === 'style' || request.destination === 'image', - handler: 'NetworkOnly', - }], - cleanupOutdatedCaches: true, - skipWaiting: true, - clientsClaim: true, - } - }) - ], + plugins: [react()], define: { 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY), 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)