fix(ui): CommandPalette outside Router context — white page fix; remove PWA; fix CSP for Google Fonts
This commit is contained in:
@@ -7,8 +7,7 @@ import { useThemeStore } from '@/store/themeStore';
|
||||
import { ErrorBoundary } from '@/components/common/ErrorBoundary';
|
||||
import { useToast } from '@/components/ui/Toast';
|
||||
import { useOnlineStatus } from '@/hooks/useOnlineStatus';
|
||||
import { CommandPalette } from '@/components/search/CommandPalette';
|
||||
import { useCommandPalette } from '@/hooks/useCommandPalette';
|
||||
|
||||
|
||||
function QueryClientWrapper({ children }: { children: React.ReactNode }) {
|
||||
const toast = useToast();
|
||||
@@ -81,7 +80,6 @@ export default function App() {
|
||||
<ErrorBoundary>
|
||||
<AppRouter />
|
||||
</ErrorBoundary>
|
||||
<CommandPalette />
|
||||
</QueryClientWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ToastContainer } from '@/components/ui/Toast';
|
||||
import { PluginRegistry } from '@/components/plugins/PluginRegistry';
|
||||
import { ErrorBoundary } from '@/components/common/ErrorBoundary';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import { CommandPalette } from '@/components/search/CommandPalette';
|
||||
|
||||
export function StartLayout() {
|
||||
return (
|
||||
@@ -22,6 +23,7 @@ export function StartLayout() {
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
</div>
|
||||
<CommandPalette />
|
||||
<ToastContainer />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,62 +1,10 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
import { resolve } from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: ['favicon.svg', 'icon-192.svg', 'icon-512.svg', 'print.css'],
|
||||
manifest: {
|
||||
name: 'LeoCRM',
|
||||
short_name: 'LeoCRM',
|
||||
description: 'Self-hosted CRM system for small sales teams',
|
||||
theme_color: '#3b82f6',
|
||||
background_color: '#0f172a',
|
||||
display: 'standalone',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: '/icon-192.svg',
|
||||
sizes: '192x192',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable',
|
||||
},
|
||||
{
|
||||
src: '/icon-512.svg',
|
||||
sizes: '512x512',
|
||||
type: 'image/svg+xml',
|
||||
purpose: 'any maskable',
|
||||
},
|
||||
],
|
||||
},
|
||||
workboxConfig: {
|
||||
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'],
|
||||
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'google-fonts-cache',
|
||||
expiration: {
|
||||
maxEntries: 10,
|
||||
maxAgeSeconds: 60 * 60 * 24 * 365,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /\/_app\/api\//i,
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
],
|
||||
},
|
||||
devOptions: {
|
||||
enabled: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user