mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Address review feedback
This commit is contained in:
parent
41083c0f9e
commit
599d6fd007
@ -36,3 +36,8 @@ if (/android/i.test(navigator.userAgent)) {
|
||||
} else {
|
||||
platform = "desktop";
|
||||
}
|
||||
|
||||
export const isFirefox = (): boolean => {
|
||||
const { userAgent } = navigator;
|
||||
return userAgent.includes("Firefox");
|
||||
};
|
||||
|
@ -33,8 +33,8 @@ import {
|
||||
audioInput as audioInputSetting,
|
||||
audioOutput as audioOutputSetting,
|
||||
videoInput as videoInputSetting,
|
||||
isFirefox,
|
||||
} from "../settings/settings";
|
||||
import { isFirefox } from "../Platform";
|
||||
|
||||
export interface MediaDevice {
|
||||
available: MediaDeviceInfo[];
|
||||
|
@ -44,8 +44,8 @@ import {
|
||||
useSetting,
|
||||
optInAnalytics as optInAnalyticsSetting,
|
||||
developerSettingsTab as developerSettingsTabSetting,
|
||||
isFirefox,
|
||||
} from "./settings";
|
||||
import { isFirefox } from "../Platform";
|
||||
|
||||
type SettingsTab =
|
||||
| "audio"
|
||||
|
@ -56,12 +56,6 @@ export function useSetting<T>(setting: Setting<T>): [T, (value: T) => void] {
|
||||
return [useObservableEagerState(setting.value), setting.setValue];
|
||||
}
|
||||
|
||||
// TODO: This doesn't belong here
|
||||
export const isFirefox = (): boolean => {
|
||||
const { userAgent } = navigator;
|
||||
return userAgent.includes("Firefox");
|
||||
};
|
||||
|
||||
// null = undecided
|
||||
export const optInAnalytics = new Setting<boolean | null>(
|
||||
"opt-in-analytics",
|
||||
@ -74,9 +68,7 @@ export const useOptInAnalytics = (): [
|
||||
((value: boolean | null) => void) | null,
|
||||
] => {
|
||||
const setting = useSetting(optInAnalytics);
|
||||
if (PosthogAnalytics.instance.isEnabled()) return setting;
|
||||
|
||||
return [false, null];
|
||||
return PosthogAnalytics.instance.isEnabled() ? setting : [false, null];
|
||||
};
|
||||
|
||||
export const developerSettingsTab = new Setting(
|
||||
|
Loading…
Reference in New Issue
Block a user