Skip to content

Commit 676286d

Browse files
committed
refactor/replace-request-notifications-with-alerts
1 parent 2c858d2 commit 676286d

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

apps/client/src/pages/SessionPage.tsx

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -585,31 +585,8 @@ function SessionPage() {
585585
return user?.id || ''
586586
}
587587

588-
// Request notification permission on component mount
589-
const requestNotificationPermission = async () => {
590-
if ('Notification' in window && Notification.permission === 'default') {
591-
try {
592-
await Notification.requestPermission()
593-
} catch (error) {
594-
console.warn('Failed to request notification permission:', error)
595-
}
596-
}
597-
}
598-
599-
// Show notification when tab is not visible
600588
const showRoomClosedNotification = (message: string) => {
601-
if ('Notification' in window && Notification.permission === 'granted') {
602-
const notification = new Notification('MOQtail Room Closed', {
603-
body: message,
604-
icon: '/moqtail.ico',
605-
requireInteraction: true, // Keep notification visible until user interacts
606-
})
607-
608-
notification.onclick = () => {
609-
window.focus()
610-
notification.close()
611-
}
612-
}
589+
alert(`MOQtail Room Closed: ${message}`)
613590
}
614591

615592
// Check if document is visible
@@ -1821,9 +1798,6 @@ function SessionPage() {
18211798

18221799
// Request notification permission and handle page visibility changes
18231800
useEffect(() => {
1824-
// Request notification permission on mount
1825-
requestNotificationPermission()
1826-
18271801
// Handle page visibility changes to show pending room closed messages
18281802
const handleVisibilityChange = () => {
18291803
if (!document.hidden && pendingRoomClosedMessage) {

0 commit comments

Comments
 (0)