From 8a414012a03571cb886588b008dfc6da065df282 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 16 May 2024 13:33:02 -0400 Subject: [PATCH] Add always show flag to view model --- src/settings/settings.ts | 2 ++ src/state/MediaViewModel.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 307a557e..4ccc78b8 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -88,3 +88,5 @@ export const videoInput = new Setting( "video-input", undefined, ); + +export const alwaysShowSelf = new Setting("always-show-self", true); diff --git a/src/state/MediaViewModel.ts b/src/state/MediaViewModel.ts index 7f7307f4..c61b5255 100644 --- a/src/state/MediaViewModel.ts +++ b/src/state/MediaViewModel.ts @@ -49,6 +49,7 @@ import { useEffect } from "react"; import { ViewModel } from "./ViewModel"; import { useReactiveState } from "../useReactiveState"; +import { alwaysShowSelf } from "../settings/settings"; export interface NameData { /** @@ -237,6 +238,13 @@ export class LocalUserMediaViewModel extends BaseUserMediaViewModel { ), ); + /** + * Whether to show this tile in a highly visible location near the start of + * the grid. + */ + public readonly alwaysShow = alwaysShowSelf.value; + public readonly setAlwaysShow = alwaysShowSelf.setValue; + public constructor( id: string, member: RoomMember | undefined,