Merge remote-tracking branch 'upstream/develop' into account-menu-splitted
# Conflicts: # app/assets/stylesheets/_sn.scss
This commit is contained in:
@@ -146,7 +146,7 @@ export class AppState {
|
||||
this.noAccountWarning.reset();
|
||||
}
|
||||
this.actionsMenu.reset();
|
||||
this.unsubApp();
|
||||
this.unsubApp?.();
|
||||
this.unsubApp = undefined;
|
||||
this.observers.length = 0;
|
||||
this.appEventObserverRemovers.forEach((remover) => remover());
|
||||
|
||||
@@ -198,9 +198,15 @@ export class NoteTagsState {
|
||||
async removeTagFromActiveNote(tag: SNTag): Promise<void> {
|
||||
const { activeNote } = this;
|
||||
if (activeNote) {
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
mutator.removeItemAsRelationship(activeNote);
|
||||
});
|
||||
const descendantTags = this.application.getTagDescendants(tag);
|
||||
const tagsToRemove = [...descendantTags, tag];
|
||||
await Promise.all(
|
||||
tagsToRemove.map(async (tag) => {
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
mutator.removeItemAsRelationship(activeNote);
|
||||
});
|
||||
})
|
||||
);
|
||||
this.application.sync();
|
||||
this.reloadTags();
|
||||
}
|
||||
|
||||
@@ -346,13 +346,18 @@ export class NotesState {
|
||||
|
||||
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
|
||||
const selectedNotes = Object.values(this.selectedNotes);
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
for (const note of selectedNotes) {
|
||||
mutator.removeItemAsRelationship(note);
|
||||
}
|
||||
});
|
||||
const descendantTags = this.application.getTagDescendants(tag);
|
||||
const tagsToRemove = [...descendantTags, tag];
|
||||
await Promise.all(
|
||||
tagsToRemove.map(async (tag) => {
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
for (const note of selectedNotes) {
|
||||
mutator.removeItemAsRelationship(note);
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
this.application.sync();
|
||||
|
||||
}
|
||||
|
||||
isTagInSelectedNotes(tag: SNTag): boolean {
|
||||
|
||||
@@ -213,11 +213,6 @@ export class WebApplication extends SNApplication {
|
||||
|
||||
async openModalComponent(component: SNComponent): Promise<void> {
|
||||
switch (component.package_info?.identifier) {
|
||||
case 'org.standardnotes.batch-manager':
|
||||
if (!await this.authorizeBatchManagerAccess()) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'org.standardnotes.cloudlink':
|
||||
if (!await this.authorizeCloudLinkAccess()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user