chore: upgrade deps
This commit is contained in:
@@ -663,7 +663,7 @@ export class NoteView extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
performNoteDeletion(note: SNNote) {
|
||||
this.application.deleteItem(note);
|
||||
this.application.mutator.deleteItem(note);
|
||||
}
|
||||
|
||||
onPanelResizeFinish = async (
|
||||
@@ -801,13 +801,13 @@ export class NoteView extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
async disassociateComponentWithCurrentNote(component: SNComponent) {
|
||||
return this.application.runTransactionalMutation(
|
||||
return this.application.mutator.runTransactionalMutation(
|
||||
transactionForDisassociateComponentWithCurrentNote(component, this.note)
|
||||
);
|
||||
}
|
||||
|
||||
async associateComponentWithCurrentNote(component: SNComponent) {
|
||||
return this.application.runTransactionalMutation(
|
||||
return this.application.mutator.runTransactionalMutation(
|
||||
transactionForAssociateComponentWithCurrentNote(component, this.note)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ export const NotesOptions = observer(
|
||||
|
||||
const duplicateSelectedItems = () => {
|
||||
notes.forEach((note) => {
|
||||
application.duplicateItem(note);
|
||||
application.mutator.duplicateItem(note);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
|
||||
) => {
|
||||
if (component) {
|
||||
if (component.conflictOf) {
|
||||
application.changeAndSaveItem(component.uuid, (mutator) => {
|
||||
application.mutator.changeAndSaveItem(component.uuid, (mutator) => {
|
||||
mutator.conflictOf = undefined;
|
||||
});
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
|
||||
);
|
||||
}
|
||||
|
||||
await application.runTransactionalMutations(transactions);
|
||||
await application.mutator.runTransactionalMutations(transactions);
|
||||
/** Dirtying can happen above */
|
||||
application.sync.sync();
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export const ExtensionPane: FunctionComponent<IProps> = observer(
|
||||
extension={extension}
|
||||
first={false}
|
||||
uninstall={() =>
|
||||
application
|
||||
application.mutator
|
||||
.deleteItem(extension)
|
||||
.then(() => preferencesMenu.loadExtensionsPanes())
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export const Extensions: FunctionComponent<{
|
||||
)
|
||||
.then(async (shouldRemove: boolean) => {
|
||||
if (shouldRemove) {
|
||||
await application.deleteItem(extension);
|
||||
await application.mutator.deleteItem(extension);
|
||||
setExtensions(loadExtensions(application));
|
||||
}
|
||||
})
|
||||
@@ -73,7 +73,7 @@ export const Extensions: FunctionComponent<{
|
||||
};
|
||||
|
||||
const confirmExtension = async () => {
|
||||
await application.insertItem(confirmableExtension as SNComponent);
|
||||
await application.mutator.insertItem(confirmableExtension as SNComponent);
|
||||
application.sync.sync();
|
||||
setExtensions(loadExtensions(application));
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ export const DataBackups = observer(({ application, appState }: Props) => {
|
||||
const performImport = async (data: BackupFile) => {
|
||||
setIsImportDataLoading(true);
|
||||
|
||||
const result = await application.importData(data);
|
||||
const result = await application.mutator.importData(data);
|
||||
|
||||
setIsImportDataLoading(false);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export const ExtensionItem: FunctionComponent<ExtensionItemProps> = ({
|
||||
const toggleOffllineOnly = () => {
|
||||
const newOfflineOnly = !offlineOnly;
|
||||
setOfflineOnly(newOfflineOnly);
|
||||
application
|
||||
application.mutator
|
||||
.changeAndSaveItem(extension.uuid, (m: any) => {
|
||||
if (m.content == undefined) m.content = {};
|
||||
m.content.offlineOnly = newOfflineOnly;
|
||||
@@ -62,7 +62,7 @@ export const ExtensionItem: FunctionComponent<ExtensionItemProps> = ({
|
||||
|
||||
const changeExtensionName = (newName: string) => {
|
||||
setExtensionName(newName);
|
||||
application
|
||||
application.mutator
|
||||
.changeAndSaveItem(extension.uuid, (m: any) => {
|
||||
if (m.content == undefined) m.content = {};
|
||||
m.content.name = newName;
|
||||
|
||||
@@ -34,7 +34,7 @@ const makeEditorDefault = (
|
||||
if (currentDefault) {
|
||||
removeEditorDefault(application, currentDefault);
|
||||
}
|
||||
application.changeAndSaveItem(component.uuid, (m) => {
|
||||
application.mutator.changeAndSaveItem(component.uuid, (m) => {
|
||||
const mutator = m as ComponentMutator;
|
||||
mutator.defaultEditor = true;
|
||||
});
|
||||
@@ -44,7 +44,7 @@ const removeEditorDefault = (
|
||||
application: WebApplication,
|
||||
component: SNComponent
|
||||
) => {
|
||||
application.changeAndSaveItem(component.uuid, (m) => {
|
||||
application.mutator.changeAndSaveItem(component.uuid, (m) => {
|
||||
const mutator = m as ComponentMutator;
|
||||
mutator.defaultEditor = false;
|
||||
});
|
||||
|
||||
@@ -218,9 +218,9 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
|
||||
|
||||
const toggleComponent = (component: SNComponent) => {
|
||||
if (component.isTheme()) {
|
||||
application.toggleTheme(component);
|
||||
application.mutator.toggleTheme(component);
|
||||
} else {
|
||||
application.toggleComponent(component);
|
||||
application.mutator.toggleComponent(component);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -265,7 +265,7 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
|
||||
const activeTheme = themes
|
||||
.map((item) => item.component)
|
||||
.find((theme) => theme?.active && !theme.isLayerable());
|
||||
if (activeTheme) application.toggleTheme(activeTheme);
|
||||
if (activeTheme) application.mutator.toggleTheme(activeTheme);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -44,7 +44,7 @@ export const ThemesMenuButton: FunctionComponent<Props> = ({
|
||||
item.component.isLayerable() || !item.component.active;
|
||||
|
||||
if (themeIsLayerableOrNotActive) {
|
||||
application.toggleTheme(item.component);
|
||||
application.mutator.toggleTheme(item.component);
|
||||
}
|
||||
} else {
|
||||
premiumModal.activate(`${item.name} theme`);
|
||||
|
||||
@@ -153,7 +153,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
|
||||
confirmButtonStyle: 'danger',
|
||||
}).then((confirmed) => {
|
||||
if (confirmed) {
|
||||
application.changeAndSaveItem(
|
||||
application.mutator.changeAndSaveItem(
|
||||
selectedRevision.payload.uuid,
|
||||
(mutator) => {
|
||||
mutator.unsafe_setCustomContent(
|
||||
@@ -175,12 +175,15 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
|
||||
selectedRevision.payload.uuid
|
||||
) as SNNote;
|
||||
|
||||
const duplicatedItem = await application.duplicateItem(originalNote, {
|
||||
...(selectedRevision.payload.content as PayloadContent),
|
||||
title: selectedRevision.payload.content.title
|
||||
? selectedRevision.payload.content.title + ' (copy)'
|
||||
: undefined,
|
||||
});
|
||||
const duplicatedItem = await application.mutator.duplicateItem(
|
||||
originalNote,
|
||||
{
|
||||
...(selectedRevision.payload.content as PayloadContent),
|
||||
title: selectedRevision.payload.content.title
|
||||
? selectedRevision.payload.content.title + ' (copy)'
|
||||
: undefined,
|
||||
}
|
||||
);
|
||||
|
||||
appState.notes.selectNote(duplicatedItem.uuid);
|
||||
|
||||
@@ -191,7 +194,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
|
||||
useEffect(() => {
|
||||
const fetchTemplateNote = async () => {
|
||||
if (selectedRevision) {
|
||||
const newTemplateNote = (await application.createTemplateItem(
|
||||
const newTemplateNote = (await application.mutator.createTemplateItem(
|
||||
ContentType.Note,
|
||||
selectedRevision.payload.content
|
||||
)) as SNNote;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class RevisionPreviewModal extends PureComponent<Props, State> {
|
||||
async componentDidMount(): Promise<void> {
|
||||
super.componentDidMount();
|
||||
|
||||
const templateNote = (await this.application.createTemplateItem(
|
||||
const templateNote = (await this.application.mutator.createTemplateItem(
|
||||
ContentType.Note,
|
||||
this.props.content
|
||||
)) as SNNote;
|
||||
@@ -60,14 +60,14 @@ export class RevisionPreviewModal extends PureComponent<Props, State> {
|
||||
restore = (asCopy: boolean) => {
|
||||
const run = async () => {
|
||||
if (asCopy) {
|
||||
await this.application.duplicateItem(this.originalNote, {
|
||||
await this.application.mutator.duplicateItem(this.originalNote, {
|
||||
...this.props.content,
|
||||
title: this.props.content.title
|
||||
? this.props.content.title + ' (copy)'
|
||||
: undefined,
|
||||
});
|
||||
} else {
|
||||
this.application.changeAndSaveItem(
|
||||
this.application.mutator.changeAndSaveItem(
|
||||
this.props.uuid,
|
||||
(mutator) => {
|
||||
mutator.unsafe_setCustomContent(this.props.content);
|
||||
|
||||
@@ -43,7 +43,7 @@ export const TagsSection: FunctionComponent<Props> = observer(
|
||||
'Run Migration'
|
||||
)
|
||||
) {
|
||||
appState.application.migrateTagsToFolders().then(() => {
|
||||
appState.application.mutator.migrateTagsToFolders().then(() => {
|
||||
checkIfMigrationNeeded();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user