Allow view change events to trigger re-render.

This commit is contained in:
Dermot Duffy
2022-01-14 21:31:16 -08:00
parent d064b6ea91
commit 16ac4146d7
9 changed files with 119 additions and 68 deletions
+4
View File
@@ -4,6 +4,7 @@ import { View } from './view';
export interface ConditionState {
view?: View;
fullscreen?: boolean;
camera?: string;
}
class ConditionStateRequestEvent extends Event {
@@ -21,6 +22,9 @@ export function evaluateCondition(
if (condition?.fullscreen !== undefined && state?.fullscreen !== undefined) {
result &&= condition?.fullscreen == state?.fullscreen;
}
if (condition?.camera?.length && state?.camera) {
result &&= condition?.camera.includes(state?.camera);
}
return result;
}