Fix auto update

This commit is contained in:
Thomas Nordquist
2019-05-02 08:40:56 +02:00
parent 4f624cc130
commit a411d21133
3 changed files with 5 additions and 30 deletions

View File

@@ -1,18 +1,14 @@
import { Base64Message } from './Model/Base64Message'
import { DataSource, MqttSource } from './DataSource'
import { UpdateInfo } from 'builder-util-runtime'
import {
AddMqttConnection,
EventDispatcher,
MqttMessage,
addMqttConnectionEvent,
backendEvents,
checkForUpdates,
makeConnectionMessageEvent,
makeConnectionStateEvent,
makePublishEvent,
removeConnection,
updateAvailable
} from '../../events'
export class ConnectionManager {
@@ -76,17 +72,3 @@ export class ConnectionManager {
.forEach(conenctionId => this.removeConnection(conenctionId))
}
}
class UpdateNotifier {
public onCheckUpdateRequest = new EventDispatcher<void, UpdateNotifier>()
constructor() {
backendEvents.subscribe(checkForUpdates, () => {
this.onCheckUpdateRequest.dispatch()
})
}
public notify(updateInfo: UpdateInfo) {
backendEvents.emit(updateAvailable, updateInfo)
}
}
export const updateNotifier = new UpdateNotifier()