fix: only warn once if triggeredNotifications are not supported
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
NOTE: Since they are deprecated they shouldn't be supported anywhere anymore. The target of this pull-request is to clean the console logging clean
This commit is contained in:
parent
65f9def438
commit
6cf32f4eb2
|
@ -21,9 +21,13 @@ import UserModel from './user'
|
||||||
import AttachmentModel from './attachment'
|
import AttachmentModel from './attachment'
|
||||||
import SubscriptionModel from './subscription'
|
import SubscriptionModel from './subscription'
|
||||||
|
|
||||||
const SUPPORTS_TRIGGERED_NOTIFICATION = 'Notification' in window && 'showTrigger' in Notification.prototype
|
|
||||||
export const TASK_DEFAULT_COLOR = '#1973ff'
|
export const TASK_DEFAULT_COLOR = '#1973ff'
|
||||||
|
|
||||||
|
const SUPPORTS_TRIGGERED_NOTIFICATION = 'Notification' in window && 'showTrigger' in Notification.prototype
|
||||||
|
if (!SUPPORTS_TRIGGERED_NOTIFICATION) {
|
||||||
|
console.debug('This browser does not support triggered notifications')
|
||||||
|
}
|
||||||
|
|
||||||
export function getHexColor(hexColor: string) {
|
export function getHexColor(hexColor: string) {
|
||||||
if (hexColor === '' || hexColor === '#') {
|
if (hexColor === '' || hexColor === '#') {
|
||||||
return TASK_DEFAULT_COLOR
|
return TASK_DEFAULT_COLOR
|
||||||
|
@ -176,7 +180,6 @@ export default class TaskModel extends AbstractModel implements ITask {
|
||||||
|
|
||||||
async cancelScheduledNotifications() {
|
async cancelScheduledNotifications() {
|
||||||
if (!SUPPORTS_TRIGGERED_NOTIFICATION) {
|
if (!SUPPORTS_TRIGGERED_NOTIFICATION) {
|
||||||
console.debug('This browser does not support triggered notifications')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +214,6 @@ export default class TaskModel extends AbstractModel implements ITask {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SUPPORTS_TRIGGERED_NOTIFICATION) {
|
if (!SUPPORTS_TRIGGERED_NOTIFICATION) {
|
||||||
console.debug('This browser does not support triggered notifications')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue