This commit is contained in:
2026-01-21 22:39:08 +06:00
parent 595354b7f0
commit 65583b1564
50 changed files with 19946 additions and 99 deletions

View File

@@ -10,7 +10,7 @@ export interface SyncedPreferences {
export const usePreferences = createGlobalState(() => {
const { videoInputs, audioInputs, audioOutputs } = useDevices()
const synced = ref(false)
const fetched = ref(false)
const inputDeviceId = useLocalStorage<MediaDeviceInfo['deviceId']>('INPUT_DEVICE_ID', 'default')
const outputDeviceId = useLocalStorage<MediaDeviceInfo['deviceId']>('OUTPUT_DEVICE_ID', 'default')
@@ -53,7 +53,7 @@ export const usePreferences = createGlobalState(() => {
)
return {
synced,
fetched,
inputDeviceId,
outputDeviceId,
autoGainControl,

View File

@@ -7,9 +7,9 @@ export default defineNuxtRouteMiddleware(async () => {
if (!me.value)
return
const { synced, toggleInputHotkey, toggleOutputHotkey } = usePreferences()
const { fetched, toggleInputHotkey, toggleOutputHotkey } = usePreferences()
if (synced.value)
if (fetched.value)
return
try {
@@ -20,7 +20,7 @@ export default defineNuxtRouteMiddleware(async () => {
toggleInputHotkey.value = preferences.toggleInputHotkey ?? toggleInputHotkey.value
toggleOutputHotkey.value = preferences.toggleOutputHotkey ?? toggleOutputHotkey.value
synced.value = true
fetched.value = true
}
catch {}
})