Refactor card.ts substantially and test.

This commit is contained in:
Dermot Duffy
2023-10-02 16:30:05 -07:00
parent 4cf13b1645
commit bfdbe70d6c
92 changed files with 8404 additions and 2996 deletions
+3 -3
View File
@@ -43,7 +43,7 @@ export class View {
* @param curr The current view.
* @returns True if the view change is a real media change.
*/
public static isMajorMediaChange(prev?: View, curr?: View): boolean {
public static isMajorMediaChange(prev?: View | null, curr?: View): boolean {
return (
!prev ||
!curr ||
@@ -61,7 +61,7 @@ export class View {
);
}
public static adoptFromViewIfAppropriate(next: View, curr?: View): void {
public static adoptFromViewIfAppropriate(next: View, curr?: View | null): void {
if (!curr) {
return;
}
@@ -229,7 +229,7 @@ export class View {
* Determine if a view is for the media viewer.
*/
public isViewerView(): boolean {
return ['clip', 'snapshot', 'media', 'recording'].includes(this.view);
return ['media', 'clip', 'snapshot', 'recording'].includes(this.view);
}
public supportsMultipleDisplayModes(): boolean {