Skip to content

Commit 5c76ff0

Browse files
shrikha56claude
andcommitted
fix(concierge): unblock venue calendar when no building is configured
The spaces observable was blocked by filter(!!_) on active_building, preventing mock events from appearing on the venue bookings calendar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f899b2b commit 5c76ff0

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

apps/concierge/src/app/day-view/events-state.service.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ import { BehaviorSubject, Observable, combineLatest, forkJoin, of } from 'rxjs';
3434
import {
3535
catchError,
3636
debounceTime,
37+
distinctUntilChanged,
3738
distinctUntilKeyChanged,
3839
filter,
3940
first,
4041
map,
4142
shareReplay,
43+
startWith,
4244
switchMap,
4345
tap,
4446
} from 'rxjs/operators';
@@ -135,10 +137,13 @@ export class EventsStateService extends AsyncHandler {
135137

136138
public readonly spaces: Observable<Space[]> = combineLatest([
137139
this._zones,
138-
this._org.active_region.pipe(distinctUntilKeyChanged('id')),
140+
this._org.active_region.pipe(
141+
startWith(null),
142+
distinctUntilChanged((a, b) => a?.id === b?.id),
143+
),
139144
this._org.active_building.pipe(
140-
filter((_) => !!_),
141-
distinctUntilKeyChanged('id'),
145+
startWith(null),
146+
distinctUntilChanged((a, b) => a?.id === b?.id),
142147
),
143148
]).pipe(
144149
debounceTime(300),
@@ -152,7 +157,11 @@ export class EventsStateService extends AsyncHandler {
152157
.map((_) => _.id)
153158
: null) || [this._org.building?.id];
154159
}
155-
return forkJoin(zone_ids.map((id) => requestSpacesForZone(id)));
160+
const valid_zones = (zone_ids || []).filter(Boolean);
161+
if (!valid_zones.length) return of([]);
162+
return forkJoin(
163+
valid_zones.map((id) => requestSpacesForZone(id)),
164+
);
156165
}),
157166
map((l) => {
158167
const api_spaces = flatten<Space>(l)

0 commit comments

Comments
 (0)