fix: Revert PWA features to restore stability and fix loading freeze in UserContext
This commit is contained in:
parent
b7c121a084
commit
fe7dabf76d
5 changed files with 4 additions and 49 deletions
|
|
@ -5,9 +5,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#059669" />
|
||||
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
|
||||
<link rel="mask-icon" href="/vite.svg" color="#059669" />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>FoodSnap.ai - Nutricionista de Bolso com Inteligência Artificial</title>
|
||||
<meta name="title" content="FoodSnap.ai - Nutricionista de Bolso com Inteligência Artificial" />
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue