MCPcopy
hub / github.com/SnapDrop/snapdrop / constructor

Method constructor

client/scripts/ui.js:398–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

396class Notifications {
397
398 constructor() {
399 // Check if the browser supports notifications
400 if (!('Notification' in window)) return;
401
402 // Check whether notification permissions have already been granted
403 if (Notification.permission !== 'granted') {
404 this.$button = $('notification');
405 this.$button.removeAttribute('hidden');
406 this.$button.addEventListener('click', e => this._requestPermission());
407 }
408 Events.on('text-received', e => this._messageNotification(e.detail.text));
409 Events.on('file-received', e => this._downloadNotification(e.detail.name));
410 }
411
412 _requestPermission() {
413 Notification.requestPermission(permission => {

Callers

nothing calls this directly

Calls 5

_requestPermissionMethod · 0.95
_messageNotificationMethod · 0.95
_downloadNotificationMethod · 0.95
$Function · 0.85
onMethod · 0.80

Tested by

no test coverage detected