optimize firebase remote reads

This commit is contained in:
2026-03-09 17:44:45 +01:00
parent d81fb3743b
commit 3e10762eaf
2 changed files with 25 additions and 2 deletions

View File

@@ -107,7 +107,8 @@ export class RemoteComponent implements OnDestroy {
this.showSongs = list;
this.show = show;
const order = show?.order ?? [];
this.presentationSongs = order.map(id => presentationSongs.find(f => f.id === id) ?? null).filter((s): s is PresentationSong => !!s);
const presentationSongsById = new Map(presentationSongs.map(song => [song.id, song] as const));
this.presentationSongs = order.map(id => presentationSongsById.get(id) ?? null).filter((s): s is PresentationSong => !!s);
this.cRef.markForCheck();
});