Dispatch message if the viewer has no media to show.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user