Skip to content

Commit

Permalink
[CastIt.Server.ClientApp] Use a BehaviorSubject in the onCastDevicesC…
Browse files Browse the repository at this point in the history
…hanged
  • Loading branch information
Wolfteam committed Mar 17, 2024
1 parent 1cc2695 commit b45e192
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CastIt.Server/ClientApp/src/services/castithub.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const onClientDisconnected = new Subject<void>();
export const onPlayerStatusChanged = new BehaviorSubject<IServerPlayerStatusResponseDto | null>(null);
export const onPlayerSettingsChanged = new BehaviorSubject<IServerAppSettings | null>(null);
export const onCastDeviceSet = new Subject<IReceiver>();
export const onCastDevicesChanged = new Subject<IReceiver[]>();
export const onCastDevicesChanged = new BehaviorSubject<IReceiver[]>([]);
export const onCastDeviceDisconnected = new Subject<void>();
export const onServerMessage = new Subject<AppMessage>();
export const onStoppedPlayback = new Subject<void>();
Expand Down Expand Up @@ -143,7 +143,7 @@ export class CastItHubService {
};

getAllPlayLists = async (): Promise<IGetAllPlayListResponseDto[]> => {
return await this.send<IGetAllPlayListResponseDto[]>('GetAllPlayLists') ?? [];
return (await this.send<IGetAllPlayListResponseDto[]>('GetAllPlayLists')) ?? [];
};

getPlayList = async (id: number): Promise<IPlayListItemResponseDto> => {
Expand Down

0 comments on commit b45e192

Please sign in to comment.