Faro & grafana improvements
This commit is contained in:
@@ -9,6 +9,7 @@ import AdminView from './views/AdminView';
|
||||
import LoginModal from './components/LoginModal';
|
||||
import SavedNotifications from './components/SavedNotifications';
|
||||
import BottomNav from './components/BottomNav';
|
||||
import { getFaro } from './utils/faro';
|
||||
|
||||
function App() {
|
||||
const [screen, setScreen] = useState('home');
|
||||
@@ -40,7 +41,10 @@ function App() {
|
||||
fetch('/api/auth/check')
|
||||
.then(r => r.json())
|
||||
.then(data => { if (data.authenticated) setCurrentUser(data.user); })
|
||||
.catch(() => {})
|
||||
.catch((err) => {
|
||||
console.warn('[auth/check]', err);
|
||||
getFaro()?.pushError(err, { type: 'network', url: '/api/auth/check' });
|
||||
})
|
||||
.finally(() => setAuthChecked(true));
|
||||
|
||||
window.addEventListener('resize', handleResize);
|
||||
@@ -57,7 +61,10 @@ function App() {
|
||||
const count = (data.global?.length || 0) + (data.pharmacy?.length || 0);
|
||||
setBadgeCount(count);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch((err) => {
|
||||
console.warn('[notifications/mine]', err);
|
||||
getFaro()?.pushError(err, { type: 'network', url: '/api/notifications/mine' });
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
}, [currentUser]);
|
||||
|
||||
@@ -69,7 +76,10 @@ function App() {
|
||||
if (!data) return;
|
||||
setBadgeCount((data.global?.length || 0) + (data.pharmacy?.length || 0));
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch((err) => {
|
||||
console.warn('[refreshBadge]', err);
|
||||
getFaro()?.pushError(err, { type: 'network', url: '/api/notifications/mine' });
|
||||
});
|
||||
}
|
||||
|
||||
function handleLogin(user) {
|
||||
|
||||
Reference in New Issue
Block a user