Merge branch 'livekit' into toger5/track-processor-blur

This commit is contained in:
Hugh Nimmo-Smith
2024-12-18 09:41:38 +00:00
71 changed files with 1337 additions and 1056 deletions

View File

@@ -31,17 +31,17 @@ export class Setting<T> {
}
}
this._value = new BehaviorSubject(initialValue);
this.value = this._value;
this._value$ = new BehaviorSubject(initialValue);
this.value$ = this._value$;
}
private readonly key: string;
private readonly _value: BehaviorSubject<T>;
public readonly value: Observable<T>;
private readonly _value$: BehaviorSubject<T>;
public readonly value$: Observable<T>;
public readonly setValue = (value: T): void => {
this._value.next(value);
this._value$.next(value);
localStorage.setItem(this.key, JSON.stringify(value));
};
}
@@ -50,7 +50,7 @@ export class Setting<T> {
* React hook that returns a settings's current value and a setter.
*/
export function useSetting<T>(setting: Setting<T>): [T, (value: T) => void] {
return [useObservableEagerState(setting.value), setting.setValue];
return [useObservableEagerState(setting.value$), setting.setValue];
}
// null = undecided
@@ -72,6 +72,10 @@ export const developerMode = new Setting("developer-settings-tab", false);
export const duplicateTiles = new Setting("duplicate-tiles", 0);
export const showNonMemberTiles = new Setting<boolean>(
"show-non-member-tiles",
false,
);
export const debugTileLayout = new Setting("debug-tile-layout", false);
export const audioInput = new Setting<string | undefined>(