chore: upgrade deps

This commit is contained in:
Mo
2022-03-21 12:13:10 -05:00
parent bd9a6e2ae5
commit cd243f39c6
21 changed files with 214 additions and 271 deletions

View File

@@ -121,7 +121,7 @@ export class NoteTagsState {
}
async createAndAddNewTag(): Promise<void> {
const newTag = await this.application.findOrCreateTag(
const newTag = await this.application.mutator.findOrCreateTag(
this.autocompleteSearchQuery
);
await this.addTagToActiveNote(newTag);
@@ -215,7 +215,7 @@ export class NoteTagsState {
async removeTagFromActiveNote(tag: SNTag): Promise<void> {
const { activeNote } = this;
if (activeNote) {
await this.application.changeItem(tag.uuid, (mutator) => {
await this.application.mutator.changeItem(tag.uuid, (mutator) => {
mutator.removeItemAsRelationship(activeNote);
});
this.application.sync.sync();

View File

@@ -260,7 +260,7 @@ export class NotesState {
async changeSelectedNotes(
mutate: (mutator: NoteMutator) => void
): Promise<void> {
await this.application.changeItems(
await this.application.mutator.changeItems(
Object.keys(this.selectedNotes),
mutate,
false
@@ -336,7 +336,7 @@ export class NotesState {
) {
if (permanently) {
for (const note of Object.values(this.selectedNotes)) {
await this.application.deleteItem(note);
await this.application.mutator.deleteItem(note);
delete this.selectedNotes[note.uuid];
}
} else {
@@ -377,10 +377,10 @@ export class NotesState {
async setProtectSelectedNotes(protect: boolean): Promise<void> {
const selectedNotes = Object.values(this.selectedNotes);
if (protect) {
await this.application.protectNotes(selectedNotes);
await this.application.mutator.protectNotes(selectedNotes);
this.setShowProtectedWarning(true);
} else {
await this.application.unprotectNotes(selectedNotes);
await this.application.mutator.unprotectNotes(selectedNotes);
this.setShowProtectedWarning(false);
}
}
@@ -396,7 +396,7 @@ export class NotesState {
}
async toggleGlobalSpellcheckForNote(note: SNNote) {
await this.application.changeItem<NoteMutator>(
await this.application.mutator.changeItem<NoteMutator>(
note.uuid,
(mutator) => {
mutator.toggleSpellcheck();
@@ -412,7 +412,7 @@ export class NotesState {
const tagsToAdd = [...parentChainTags, tag];
await Promise.all(
tagsToAdd.map(async (tag) => {
await this.application.changeItem(tag.uuid, (mutator) => {
await this.application.mutator.changeItem(tag.uuid, (mutator) => {
for (const note of selectedNotes) {
mutator.addItemAsRelationship(note);
}
@@ -424,7 +424,7 @@ export class NotesState {
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
const selectedNotes = Object.values(this.selectedNotes);
await this.application.changeItem(tag.uuid, (mutator) => {
await this.application.mutator.changeItem(tag.uuid, (mutator) => {
for (const note of selectedNotes) {
mutator.removeItemAsRelationship(note);
}
@@ -452,7 +452,7 @@ export class NotesState {
confirmButtonStyle: 'danger',
})
) {
this.application.emptyTrash();
this.application.mutator.emptyTrash();
this.application.sync.sync();
}
}

View File

@@ -498,7 +498,7 @@ export class NotesViewState {
handleEditorChange = async () => {
const activeNote = this.appState.getActiveNoteController()?.note;
if (activeNote && activeNote.conflictOf) {
this.application.changeAndSaveItem(activeNote.uuid, (mutator) => {
this.application.mutator.changeAndSaveItem(activeNote.uuid, (mutator) => {
mutator.conflictOf = undefined;
});
}

View File

@@ -194,7 +194,7 @@ export class TagsState {
return;
}
const createdTag = (await this.application.createTagOrSmartView(
const createdTag = (await this.application.mutator.createTagOrSmartView(
title
)) as SNTag;
@@ -355,13 +355,13 @@ export class TagsState {
if (!isValidFutureSiblings(this.application, futureSiblings, tag)) {
return;
}
await this.application.unsetTagParent(tag);
await this.application.mutator.unsetTagParent(tag);
} else {
const futureSiblings = this.application.getTagChildren(futureParent);
if (!isValidFutureSiblings(this.application, futureSiblings, tag)) {
return;
}
await this.application.setTagParent(futureParent, tag);
await this.application.mutator.setTagParent(futureParent, tag);
}
await this.application.sync.sync();
@@ -393,7 +393,7 @@ export class TagsState {
public set selected(tag: AnyTag | undefined) {
if (tag && tag.conflictOf) {
this.application.changeAndSaveItem(tag.uuid, (mutator) => {
this.application.mutator.changeAndSaveItem(tag.uuid, (mutator) => {
mutator.conflictOf = undefined;
});
}
@@ -409,9 +409,12 @@ export class TagsState {
}
public setExpanded(tag: SNTag, expanded: boolean) {
this.application.changeAndSaveItem<TagMutator>(tag.uuid, (mutator) => {
mutator.expanded = expanded;
});
this.application.mutator.changeAndSaveItem<TagMutator>(
tag.uuid,
(mutator) => {
mutator.expanded = expanded;
}
);
}
public get selectedUuid(): UuidString | undefined {
@@ -435,7 +438,7 @@ export class TagsState {
return;
}
const newTag = (await this.application.createTemplateItem(
const newTag = (await this.application.mutator.createTemplateItem(
ContentType.Tag
)) as SNTag;
@@ -459,7 +462,7 @@ export class TagsState {
});
}
if (shouldDelete) {
this.application.deleteItem(tag);
this.application.mutator.deleteItem(tag);
this.selected = this.smartViews[0];
}
}
@@ -506,13 +509,15 @@ export class TagsState {
}
}
const insertedTag = await this.application.createTagOrSmartView(newTitle);
const insertedTag = await this.application.mutator.createTagOrSmartView(
newTitle
);
this.application.sync.sync();
runInAction(() => {
this.selected = insertedTag as SNTag;
});
} else {
await this.application.changeAndSaveItem<TagMutator>(
await this.application.mutator.changeAndSaveItem<TagMutator>(
tag.uuid,
(mutator) => {
mutator.title = newTitle;