internal: incomplete vault systems behind feature flag (#2340)
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user