Dispatch message if the viewer has no media to show.

This commit is contained in:
Dermot Duffy
2023-01-24 19:36:54 -08:00
parent 5be6ee86e0
commit e0d2dfaa60
8 changed files with 26 additions and 30 deletions
+5 -7
View File
@@ -202,13 +202,11 @@ export class DataManager {
}
}
return mediaArray.length
? new MediaQueriesResults(
orderBy(mediaArray, (media) => media.getStartTime(), 'desc'),
// Select the first (most-recent) item.
0,
)
: null;
return new MediaQueriesResults(
orderBy(mediaArray, (media) => media.getStartTime(), 'desc'),
// Select the first (most-recent) item.
mediaArray.length ? 0 : null,
);
}
public getMediaDownloadPath(media: ViewMedia): string | null {
+2 -2
View File
@@ -54,9 +54,9 @@ export const createViewForEvents = async (
const queries = dataManager.generateDefaultEventQueries(cameraIDs, {
...(options?.limit && { limit: options.limit }),
...((!options?.mediaType || ['clips', 'all'].includes(options.mediaType)) && {
has_clip: true,
hasClip: true,
}),
...(options?.mediaType === 'snapshots' && { has_snapshot: true }),
...(options?.mediaType === 'snapshots' && { hasSnapshot: true }),
});
query = new EventMediaQueries(queries);
}