internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -1,5 +1,5 @@
import { WebApplication } from '@/Application/WebApplication'
import { InternalEventBus, SNNote } from '@standardnotes/snjs'
import { InternalEventBusInterface, SNNote } from '@standardnotes/snjs'
import { OPEN_NOTE_HISTORY_COMMAND } from '@standardnotes/ui-services'
import { action, makeObservable, observable } from 'mobx'
import { AbstractViewController } from '../Abstract/AbstractViewController'
@@ -13,7 +13,11 @@ export class HistoryModalController extends AbstractViewController {
this.note = undefined
}
constructor(application: WebApplication, eventBus: InternalEventBus, notesController: NotesControllerInterface) {
constructor(
application: WebApplication,
eventBus: InternalEventBusInterface,
notesController: NotesControllerInterface,
) {
super(application, eventBus)
makeObservable(this, {

View File

@@ -330,7 +330,7 @@ export class NoteHistoryController {
}
if (didConfirm) {
void this.application.mutator.changeAndSaveItem(
void this.application.changeAndSaveItem(
originalNote,
(mutator) => {
mutator.setCustomContent(revision.payload.content)
@@ -344,11 +344,13 @@ export class NoteHistoryController {
restoreRevisionAsCopy = async (revision: NonNullable<SelectedRevision>) => {
const originalNote = this.application.items.findSureItem<SNNote>(revision.payload.uuid)
const duplicatedItem = await this.application.mutator.duplicateItem(originalNote, {
const duplicatedItem = await this.application.mutator.duplicateItem(originalNote, false, {
...revision.payload.content,
title: revision.payload.content.title ? revision.payload.content.title + ' (copy)' : undefined,
})
void this.application.sync.sync()
this.selectionController.selectItem(duplicatedItem.uuid).catch(console.error)
}