add WebSocket support for real-time delivery updates with JWT authentication and automatic reconnection
This commit is contained in:
@@ -7,6 +7,7 @@ import { Button } from './components/ui/Button';
|
||||
import { UpdatePrompt } from './components/ui/UpdatePrompt';
|
||||
import { useDeliveryStore } from './stores/deliveryStore';
|
||||
import { useAuthStore } from './stores/authStore';
|
||||
import { useWebSocket } from './hooks/useWebSocket';
|
||||
|
||||
// Lazy load pages for code splitting
|
||||
const Dashboard = lazy(() => import('./pages/Dashboard'));
|
||||
@@ -30,6 +31,8 @@ function App() {
|
||||
const addDelivery = useDeliveryStore(state => state.addDelivery);
|
||||
const fetchDeliveryCounts = useDeliveryStore(state => state.fetchDeliveryCounts);
|
||||
|
||||
useWebSocket();
|
||||
|
||||
// Restore auth on mount
|
||||
useEffect(() => {
|
||||
restoreAuth();
|
||||
|
||||
Reference in New Issue
Block a user