Merge pull request #2444 from mempool/nymkappa/bugfix/infinite-loading-no-channel

Fix infinite loading spinner in channel map when no active channel exists
This commit is contained in:
wiz 2022-08-30 11:08:11 +02:00 committed by GitHub
commit 916042faab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,13 +44,13 @@ export class NodeChannels implements OnChanges {
switchMap((response) => { switchMap((response) => {
this.isLoading = true; this.isLoading = true;
if ((response.body?.length ?? 0) <= 0) { if ((response.body?.length ?? 0) <= 0) {
return []; this.isLoading = false;
return [''];
} }
return [response.body]; return [response.body];
}), }),
tap((body: any[]) => { tap((body: any[]) => {
if (body.length === 0) { if (body.length === 0 || body[0].length === 0) {
this.isLoading = false;
return; return;
} }
const biggestCapacity = body[0].capacity; const biggestCapacity = body[0].capacity;