fix: note comparison in template

This commit is contained in:
Mo Bitar
2020-04-21 13:55:16 -05:00
parent 35434f8af3
commit 9023f76417
13 changed files with 38 additions and 42 deletions

View File

@@ -319,9 +319,9 @@ class AccountMenuCtrl extends PureViewCtrl {
}
async openPrivilegesModal() {
this.close();
const run = () => {
this.application!.presentPrivilegesManagementModal();
this.close();
};
const needsPrivilege = await this.application!.privilegesService!.actionRequiresPrivilege(
ProtectedAction.ManagePrivileges

View File

@@ -90,21 +90,18 @@ class RevisionPreviewModalCtrl implements RevisionPreviewScope {
restore(asCopy: boolean) {
const run = async () => {
let item;
if (asCopy) {
const contentCopy = Object.assign({}, this.content);
if (contentCopy.title) {
contentCopy.title += " (copy)";
}
item = await this.application.createManagedItem(
await this.application.createManagedItem(
ContentType.Note,
contentCopy,
true
);
} else {
const uuid = this.uuid;
item = this.application.findItem(uuid)!;
this.application.changeAndSaveItem(item.uuid, (mutator) => {
this.application.changeAndSaveItem(this.uuid, (mutator) => {
mutator.setContent(this.content);
}, true, PayloadSource.RemoteActionRetrieved);
}

View File

@@ -102,7 +102,7 @@
)
.note(
ng-repeat='note in self.state.renderedNotes track by note.uuid'
ng-class="{'selected' : self.activeEditorNote == note}"
ng-class="{'selected' : self.activeEditorNote.uuid == note.uuid}"
ng-click='self.selectNote(note)'
)
.note-flags(ng-show='self.noteFlags[note.uuid].length > 0')