Refactor card.ts substantially and test.
This commit is contained in:
+3
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user