fix(loading): update loading checks to use signal() for reactive state management (#727)
This commit is contained in:
+2
-2
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (loading) {
|
||||
@if (loading()) {
|
||||
|
||||
<div class="loading-overlay">
|
||||
<div class="loading-content">
|
||||
@@ -269,7 +269,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!loading) {
|
||||
@if (!loading()) {
|
||||
<p-divider></p-divider>
|
||||
|
||||
<div class="footer">
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import {Component, DestroyRef, inject, OnInit, QueryList, ViewChildren} from '@angular/core';
|
||||
import {Component, DestroyRef, inject, OnInit, QueryList, signal, ViewChildren} from '@angular/core';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {startWith, take, tap} from 'rxjs/operators';
|
||||
import {PageTitleService} from "../../../../shared/service/page-title.service";
|
||||
@@ -86,7 +86,7 @@ export class BookdropFileReviewComponent implements OnInit {
|
||||
bookdropFileUis: BookdropFileUI[] = [];
|
||||
fileUiCache: Record<number, BookdropFileUI> = {};
|
||||
copiedFlags: Record<number, boolean> = {};
|
||||
loading = true;
|
||||
loading = signal(true);
|
||||
saving = false;
|
||||
includeCoversOnCopy = true;
|
||||
|
||||
@@ -102,7 +102,7 @@ export class BookdropFileReviewComponent implements OnInit {
|
||||
|
||||
this.activatedRoute.queryParams
|
||||
.pipe(startWith({}), tap(() => {
|
||||
this.loading = true;
|
||||
this.loading.set(true);
|
||||
this.loadPage(0);
|
||||
}))
|
||||
.subscribe();
|
||||
@@ -198,12 +198,12 @@ export class BookdropFileReviewComponent implements OnInit {
|
||||
});
|
||||
this.totalRecords = response.page.totalElements;
|
||||
this.currentPage = page;
|
||||
this.loading = false;
|
||||
this.loading.set(false);
|
||||
this.syncCurrentPageSelection();
|
||||
},
|
||||
error: err => {
|
||||
console.error('Error loading files:', err);
|
||||
this.loading = false;
|
||||
this.loading.set(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user