v0.4.4 polishing (#515)
* Fixed a bad comparision between JsonElement and null. * Removed console.logs. Fixed bug in edit collection detail page where summary wouldn't update after editing it. * Removed a UI package that is no longer used. Fixed an issue where MarkVolumeAsUnread was using an old set of APIs and now uses the new, faster API.
This commit is contained in:
parent
9568d9b2e5
commit
e479f17aa6
8 changed files with 23 additions and 29 deletions
|
|
@ -56,25 +56,29 @@ export class CollectionDetailComponent implements OnInit {
|
|||
return;
|
||||
}
|
||||
const tagId = parseInt(routeId, 10);
|
||||
this.collectionService.allTags().subscribe(tags => {
|
||||
this.collections = tags;
|
||||
const matchingTags = this.collections.filter(t => t.id === tagId);
|
||||
if (matchingTags.length === 0) {
|
||||
this.toastr.error('You don\'t have access to any libraries this tag belongs to or this tag is invalid');
|
||||
|
||||
return;
|
||||
}
|
||||
this.collectionTag = matchingTags[0];
|
||||
this.tagImage = this.imageService.randomize(this.imageService.getCollectionCoverImage(this.collectionTag.id));
|
||||
this.titleService.setTitle('Kavita - ' + this.collectionTag.title + ' Collection');
|
||||
this.loadPage();
|
||||
});
|
||||
this.updateTag(tagId);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.collectionTagActions = this.actionFactoryService.getCollectionTagActions(this.handleCollectionActionCallback.bind(this));
|
||||
}
|
||||
|
||||
updateTag(tagId: number) {
|
||||
this.collectionService.allTags().subscribe(tags => {
|
||||
this.collections = tags;
|
||||
const matchingTags = this.collections.filter(t => t.id === tagId);
|
||||
if (matchingTags.length === 0) {
|
||||
this.toastr.error('You don\'t have access to any libraries this tag belongs to or this tag is invalid');
|
||||
|
||||
return;
|
||||
}
|
||||
this.collectionTag = matchingTags[0];
|
||||
this.tagImage = this.imageService.randomize(this.imageService.getCollectionCoverImage(this.collectionTag.id));
|
||||
this.titleService.setTitle('Kavita - ' + this.collectionTag.title + ' Collection');
|
||||
this.loadPage();
|
||||
});
|
||||
}
|
||||
|
||||
onPageChange(pagination: Pagination) {
|
||||
this.router.navigate(['collections', this.collectionTag.id], {replaceUrl: true, queryParamsHandling: 'merge', queryParams: {page: this.seriesPagination.currentPage} });
|
||||
}
|
||||
|
|
@ -120,6 +124,7 @@ export class CollectionDetailComponent implements OnInit {
|
|||
const modalRef = this.modalService.open(EditCollectionTagsComponent, { size: 'lg', scrollable: true });
|
||||
modalRef.componentInstance.tag = this.collectionTag;
|
||||
modalRef.closed.subscribe((results: {success: boolean, coverImageUpdated: boolean}) => {
|
||||
this.updateTag(this.collectionTag.id);
|
||||
this.loadPage();
|
||||
if (results.coverImageUpdated) {
|
||||
this.tagImage = this.imageService.randomize(this.imageService.getCollectionCoverImage(collectionTag.id));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue