Polish for Release (#2841)

This commit is contained in:
Joe Milazzo 2024-04-10 16:51:40 -05:00 committed by GitHub
parent a76de06087
commit e6e228c3d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 46 additions and 36 deletions

View file

@ -47,7 +47,7 @@
<input width="100%" #title ngbAutofocus type="text" class="form-control mb-2" id="add-rlist" formControlName="title">
</div>
<div class="col-2">
<button type="submit" class="btn btn-primary" (click)="create()">{{t('create')}}</button>
<button type="submit" class="btn btn-primary" [disabled]="isCreating" (click)="create()">{{t('create')}}</button>
</div>
</div>
</div>

View file

@ -48,6 +48,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
*/
lists: Array<UserCollection> = [];
loading: boolean = false;
isCreating: boolean = false;
listForm: FormGroup = new FormGroup({});
ngOnInit(): void {
@ -77,9 +78,13 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
}
create() {
if (this.isCreating) return;
const tagName = this.listForm.value.title;
this.isCreating = true;
this.cdRef.markForCheck();
this.collectionService.addByMultiple(0, this.seriesIds, tagName).subscribe(() => {
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.isCreating = false;
this.modal.close();
});
}