Fix: Deselect items when they are removed from current view in book browser (#2093)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
@@ -557,7 +557,8 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
|
|||||||
this.selectedBooks.clear();
|
this.selectedBooks.clear();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reject: () => {}
|
reject: () => {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,6 +657,13 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
openShelfAssigner(): void {
|
openShelfAssigner(): void {
|
||||||
this.dynamicDialogRef = this.dialogHelperService.openShelfAssignerDialog(null, this.selectedBooks);
|
this.dynamicDialogRef = this.dialogHelperService.openShelfAssignerDialog(null, this.selectedBooks);
|
||||||
|
if (this.dynamicDialogRef) {
|
||||||
|
this.dynamicDialogRef.onClose.subscribe(result => {
|
||||||
|
if (result.assigned) {
|
||||||
|
this.selectedBooks.clear();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lockUnlockMetadata(): void {
|
lockUnlockMetadata(): void {
|
||||||
|
|||||||
+3
-3
@@ -74,11 +74,11 @@ export class ShelfAssignerComponent implements OnInit {
|
|||||||
.subscribe({
|
.subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
this.messageService.add({severity: 'info', summary: 'Success', detail: 'Book shelves updated'});
|
this.messageService.add({severity: 'info', summary: 'Success', detail: 'Book shelves updated'});
|
||||||
this.dynamicDialogRef.close();
|
this.dynamicDialogRef.close({assigned: true});
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.messageService.add({severity: 'error', summary: 'Error', detail: 'Failed to update book shelves'});
|
this.messageService.add({severity: 'error', summary: 'Error', detail: 'Failed to update book shelves'});
|
||||||
this.dynamicDialogRef.close();
|
this.dynamicDialogRef.close({assigned: false});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ export class ShelfAssignerComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeDialog(): void {
|
closeDialog(): void {
|
||||||
this.dynamicDialogRef.close();
|
this.dynamicDialogRef.close({assigned: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
isShelfSelected(shelf: Shelf): boolean {
|
isShelfSelected(shelf: Shelf): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user