fix: add checks to lesson notifications

This commit is contained in:
SethBurkart123
2024-06-06 13:19:34 +10:00
parent 6648b350ab
commit 24ff97a548
+3 -6
View File
@@ -1507,12 +1507,9 @@ function CheckCurrentLesson(lesson: any, num: number) {
if (Notification.permission === 'granted') {
new Notification('Next Lesson in 5 Minutes:', {
body:
'Subject: ' +
lesson.description +
' \nRoom: ' +
lesson.room +
' \nTeacher: ' +
lesson.staff,
`Subject: ${lesson.description}` +
(lesson.room ? `\nRoom: ${lesson.room}` : '') +
(lesson.staff ? `\nTeacher: ${lesson.staff}` : ''),
})
} else {
// request permission from user