mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 15:19:42 +02:00
Update:Refactor socket connection management into SocketAuthority
This commit is contained in:
parent
42e68edc65
commit
e2af33e136
22 changed files with 386 additions and 341 deletions
|
@ -1,11 +1,11 @@
|
|||
const axios = require('axios')
|
||||
const Logger = require("../Logger")
|
||||
const SocketAuthority = require('../SocketAuthority')
|
||||
const { notificationData } = require('../utils/notifications')
|
||||
|
||||
class NotificationManager {
|
||||
constructor(db, emitter) {
|
||||
constructor(db) {
|
||||
this.db = db
|
||||
this.emitter = emitter
|
||||
|
||||
this.sendingNotification = false
|
||||
this.notificationQueue = []
|
||||
|
@ -58,7 +58,7 @@ class NotificationManager {
|
|||
}
|
||||
|
||||
await this.db.updateEntity('settings', this.db.notificationSettings)
|
||||
this.emitter('notifications_updated', this.db.notificationSettings)
|
||||
SocketAuthority.emitter('notifications_updated', this.db.notificationSettings)
|
||||
|
||||
this.notificationFinished()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue