feat: file backups (#1024)
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
removeFromArray,
|
||||
Uuid,
|
||||
PayloadEmitSource,
|
||||
WebOrDesktopDeviceInterface,
|
||||
} from '@standardnotes/snjs'
|
||||
import { action, computed, IReactionDisposer, makeObservable, observable, reaction } from 'mobx'
|
||||
import { ActionsMenuState } from './ActionsMenuState'
|
||||
@@ -31,7 +32,6 @@ import { SearchOptionsState } from './SearchOptionsState'
|
||||
import { SubscriptionState } from './SubscriptionState'
|
||||
import { SyncState } from './SyncState'
|
||||
import { TagsState } from './TagsState'
|
||||
import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice'
|
||||
import { FilePreviewModalState } from './FilePreviewModalState'
|
||||
|
||||
export enum AppStateEvent {
|
||||
@@ -93,7 +93,7 @@ export class AppState {
|
||||
|
||||
private readonly tagChangedDisposer: IReactionDisposer
|
||||
|
||||
constructor(application: WebApplication, private device: WebOrDesktopDevice) {
|
||||
constructor(application: WebApplication, private device: WebOrDesktopDeviceInterface) {
|
||||
this.application = application
|
||||
this.notes = new NotesState(
|
||||
application,
|
||||
|
||||
@@ -2,10 +2,8 @@ import { WebCrypto } from '@/Crypto'
|
||||
import { WebAlertService } from '@/Services/AlertService'
|
||||
import { ArchiveManager } from '@/Services/ArchiveManager'
|
||||
import { AutolockService } from '@/Services/AutolockService'
|
||||
import { DesktopDeviceInterface, isDesktopDevice } from '@/Device/DesktopDeviceInterface'
|
||||
import { DesktopManager } from '@/Services/DesktopManager'
|
||||
import { IOService } from '@/Services/IOService'
|
||||
import { StatusManager } from '@/Services/StatusManager'
|
||||
import { ThemeManager } from '@/Services/ThemeManager'
|
||||
import { AppState } from '@/UIModels/AppState'
|
||||
import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice'
|
||||
@@ -17,6 +15,8 @@ import {
|
||||
removeFromArray,
|
||||
IconsController,
|
||||
Runtime,
|
||||
DesktopDeviceInterface,
|
||||
isDesktopDevice,
|
||||
} from '@standardnotes/snjs'
|
||||
|
||||
type WebServices = {
|
||||
@@ -24,7 +24,6 @@ type WebServices = {
|
||||
desktopService?: DesktopManager
|
||||
autolockService: AutolockService
|
||||
archiveService: ArchiveManager
|
||||
statusManager: StatusManager
|
||||
themeService: ThemeManager
|
||||
io: IOService
|
||||
}
|
||||
@@ -137,10 +136,6 @@ export class WebApplication extends SNApplication {
|
||||
return undefined
|
||||
}
|
||||
|
||||
getStatusManager() {
|
||||
return this.webServices.statusManager
|
||||
}
|
||||
|
||||
public getThemeService() {
|
||||
return this.webServices.themeService
|
||||
}
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
import { WebApplication } from './Application'
|
||||
import { ApplicationDescriptor, SNApplicationGroup, Platform, Runtime, InternalEventBus } from '@standardnotes/snjs'
|
||||
import {
|
||||
ApplicationDescriptor,
|
||||
SNApplicationGroup,
|
||||
Platform,
|
||||
Runtime,
|
||||
InternalEventBus,
|
||||
isDesktopDevice,
|
||||
} from '@standardnotes/snjs'
|
||||
import { AppState } from '@/UIModels/AppState'
|
||||
import { getPlatform, isDesktopApplication } from '@/Utils'
|
||||
import { ArchiveManager } from '@/Services/ArchiveManager'
|
||||
import { DesktopManager } from '@/Services/DesktopManager'
|
||||
import { IOService } from '@/Services/IOService'
|
||||
import { AutolockService } from '@/Services/AutolockService'
|
||||
import { StatusManager } from '@/Services/StatusManager'
|
||||
import { ThemeManager } from '@/Services/ThemeManager'
|
||||
import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice'
|
||||
import { isDesktopDevice } from '@/Device/DesktopDeviceInterface'
|
||||
|
||||
export class ApplicationGroup extends SNApplicationGroup<WebOrDesktopDevice> {
|
||||
constructor(
|
||||
@@ -53,7 +58,6 @@ export class ApplicationGroup extends SNApplicationGroup<WebOrDesktopDevice> {
|
||||
const archiveService = new ArchiveManager(application)
|
||||
const io = new IOService(platform === Platform.MacWeb || platform === Platform.MacDesktop)
|
||||
const autolockService = new AutolockService(application, new InternalEventBus())
|
||||
const statusManager = new StatusManager()
|
||||
const themeService = new ThemeManager(application)
|
||||
|
||||
application.setWebServices({
|
||||
@@ -62,7 +66,6 @@ export class ApplicationGroup extends SNApplicationGroup<WebOrDesktopDevice> {
|
||||
desktopService: isDesktopDevice(this.device) ? new DesktopManager(application, this.device) : undefined,
|
||||
io,
|
||||
autolockService,
|
||||
statusManager,
|
||||
themeService,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user