Add always show flag to view model

This commit is contained in:
Robin
2024-05-16 13:33:02 -04:00
parent e33fbd77d1
commit 8a414012a0
2 changed files with 10 additions and 0 deletions

View File

@@ -88,3 +88,5 @@ export const videoInput = new Setting<string | undefined>(
"video-input",
undefined,
);
export const alwaysShowSelf = new Setting<boolean>("always-show-self", true);

View File

@@ -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,