bug fixes
This commit is contained in:
@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
|
||||
import { api } from '../utils/api.js';
|
||||
import { useToast } from '../contexts/ToastContext.jsx';
|
||||
import { useAuth } from '../contexts/AuthContext.jsx';
|
||||
import { useSocket } from '../contexts/SocketContext.jsx';
|
||||
import UserFooter from './UserFooter.jsx';
|
||||
import MobileEventForm from './MobileEventForm.jsx';
|
||||
import ColourPickerSheet from './ColourPickerSheet.jsx';
|
||||
@@ -1471,6 +1472,7 @@ function MonthView({ events: rawEvents, selectedDate, onSelect, onSelectDay }) {
|
||||
export default function SchedulePage({ isToolManager, isMobile, onProfile, onHelp, onAbout }) {
|
||||
const { user } = useAuth();
|
||||
const toast = useToast();
|
||||
const { socket } = useSocket();
|
||||
|
||||
// Mobile: only day + schedule views
|
||||
const allowedViews = isMobile ? ['schedule','day'] : ['schedule','day','week','month'];
|
||||
@@ -1502,6 +1504,13 @@ export default function SchedulePage({ isToolManager, isMobile, onProfile, onHel
|
||||
|
||||
useEffect(() => { load(); }, [load]);
|
||||
|
||||
// Re-fetch when removed from a user group (private event visibility may change)
|
||||
useEffect(() => {
|
||||
if (!socket) return;
|
||||
socket.on('schedule:refresh', load);
|
||||
return () => socket.off('schedule:refresh', load);
|
||||
}, [socket, load]);
|
||||
|
||||
// Reset scroll to top on date/view change; schedule view scrolls to today via ScheduleView's own effect
|
||||
useEffect(() => { if (contentRef.current && view !== 'schedule') contentRef.current.scrollTop = 0; }, [selDate, view]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user