bug fixes
This commit is contained in:
@@ -28,6 +28,7 @@ export default function ProfileModal({ onClose }) {
|
||||
typeof Notification !== 'undefined' ? Notification.permission : 'unsupported'
|
||||
);
|
||||
const isIOS = /iphone|ipad/i.test(navigator.userAgent);
|
||||
const isStandalone = window.navigator.standalone === true;
|
||||
const [hideAdminTag, setHideAdminTag] = useState(!!user?.hide_admin_tag);
|
||||
const [allowDm, setAllowDm] = useState(user?.allow_dm !== 0);
|
||||
|
||||
@@ -213,6 +214,21 @@ export default function ProfileModal({ onClose }) {
|
||||
|
||||
{tab === 'notifications' && (
|
||||
<div className="flex-col gap-3">
|
||||
{isIOS && !isStandalone ? (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, padding: '12px 14px', borderRadius: 8, background: 'var(--surface-variant)', border: '1px solid var(--border)' }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text-primary)' }}>Home Screen required for notifications</div>
|
||||
<div style={{ fontSize: 13, color: 'var(--text-secondary)', lineHeight: 1.6 }}>
|
||||
Push notifications on iPhone require RosterChirp to be installed as an app. To do this:
|
||||
<ol style={{ margin: '8px 0 0', paddingLeft: 18, display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||
<li>Tap the <strong>Share</strong> button (<svg style={{ display: 'inline', verticalAlign: 'middle', margin: '0 2px' }} width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" y1="2" x2="12" y2="15"/></svg>) at the bottom of Safari</li>
|
||||
<li>Select <strong>"Add to Home Screen"</strong></li>
|
||||
<li>Tap <strong>Add</strong>, then open RosterChirp from your Home Screen</li>
|
||||
<li>Go to <strong>Profile → Notifications</strong> to enable push notifications</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{notifPermission !== 'granted' && notifPermission !== 'unsupported' && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, padding: '10px 12px', borderRadius: 8, background: 'var(--surface-variant)' }}>
|
||||
<div style={{ fontSize: 14, color: 'var(--text-secondary)' }}>
|
||||
@@ -314,6 +330,8 @@ export default function ProfileModal({ onClose }) {
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -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