Skip to content

Commit 2724c54

Browse files
committed
chore(zones): add error handling to tag listing request
1 parent 881d87d commit 2724c54

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/app/zones/zones.component.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MatRippleModule } from '@angular/material/core';
55
import { MatTooltipModule } from '@angular/material/tooltip';
66
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
77
import { listZoneTags, PlaceZone } from '@placeos/ts-client';
8-
import { shareReplay } from 'rxjs';
8+
import { catchError, of, shareReplay } from 'rxjs';
99
import { extensionsForItem } from '../common/api';
1010
import { AsyncHandler } from '../common/async-handler.class';
1111
import { PlaceDebugService } from '../common/debug.service';
@@ -192,7 +192,12 @@ export class ZonesComponent extends AsyncHandler {
192192

193193
public readonly newItem = () => this._item.create();
194194
public readonly bulkAdd = () => this._item.bulkAdd();
195-
public readonly zone_tags = toSignal(listZoneTags().pipe(shareReplay(1)), {
196-
initialValue: [],
197-
});
195+
public readonly zone_tags = toSignal(
196+
listZoneTags()
197+
.pipe(catchError(() => of([])))
198+
.pipe(shareReplay(1)),
199+
{
200+
initialValue: [],
201+
},
202+
);
198203
}

0 commit comments

Comments
 (0)