feat: file backups (#1024)
This commit is contained in:
@@ -10,10 +10,10 @@ import {
|
||||
DecryptedTransferPayload,
|
||||
ComponentContent,
|
||||
assert,
|
||||
DesktopClientRequiresWebMethods,
|
||||
DesktopDeviceInterface,
|
||||
} from '@standardnotes/snjs'
|
||||
import { WebAppEvent, WebApplication } from '@/UIModels/Application'
|
||||
import { DesktopDeviceInterface } from '../Device/DesktopDeviceInterface'
|
||||
import { DesktopClientRequiresWebMethods } from '@/Device/DesktopWebCommunication'
|
||||
|
||||
export class DesktopManager
|
||||
extends ApplicationService
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import { removeFromArray } from '@standardnotes/snjs'
|
||||
|
||||
type StatusCallback = (string: string) => void
|
||||
|
||||
export class StatusManager {
|
||||
private _message = ''
|
||||
private observers: StatusCallback[] = []
|
||||
|
||||
get message(): string {
|
||||
return this._message
|
||||
}
|
||||
|
||||
setMessage(message: string) {
|
||||
this._message = message
|
||||
this.notifyObservers()
|
||||
}
|
||||
|
||||
onStatusChange(callback: StatusCallback) {
|
||||
this.observers.push(callback)
|
||||
return () => {
|
||||
removeFromArray(this.observers, callback)
|
||||
}
|
||||
}
|
||||
|
||||
private notifyObservers() {
|
||||
for (const observer of this.observers) {
|
||||
observer(this._message)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user