fix
This commit is contained in:
@@ -58,6 +58,18 @@ const host = ref<HostInfo>({
|
||||
})
|
||||
const display = ref<number | null>(null)
|
||||
const isBusy = ref(false)
|
||||
const isCheckingSound = ref(false)
|
||||
async function checkSound() {
|
||||
if (!bridge || isCheckingSound.value) return
|
||||
isCheckingSound.value = true
|
||||
try {
|
||||
await bridge.checkSound()
|
||||
} catch (error) {
|
||||
message.error(error instanceof Error ? error.message : 'Не удалось проверить звук')
|
||||
} finally {
|
||||
isCheckingSound.value = false
|
||||
}
|
||||
}
|
||||
const preview = ref<PreviewFrame | null>(null)
|
||||
const previewURL = computed(() =>
|
||||
preview.value?.session === state.value?.session &&
|
||||
@@ -292,12 +304,18 @@ onUnmounted(() => {
|
||||
{ label: 'По умолчанию в системе', value: '' },
|
||||
...(host.audioOutputs ?? []).map((device) => ({ label: device.label, value: device.id })),
|
||||
]"
|
||||
:disabled="isBusy"
|
||||
:disabled="isBusy || isCheckingSound"
|
||||
:input-props="{ id: 'audio-output-input', 'aria-label': 'Вывод звука' }"
|
||||
@update:value="selectAudioOutput"
|
||||
/>
|
||||
<n-alert v-if="host.audioOutputNotice" type="warning" role="status">{{ host.audioOutputNotice }}</n-alert>
|
||||
<n-space align="center">
|
||||
<n-button
|
||||
data-testid="check-sound"
|
||||
:disabled="isBusy || isCheckingSound"
|
||||
:loading="isCheckingSound"
|
||||
@click="checkSound"
|
||||
>Проверка звука</n-button>
|
||||
<n-button
|
||||
v-if="!state?.outputOpen"
|
||||
:disabled="display === null || isBusy"
|
||||
|
||||
@@ -155,6 +155,7 @@ export interface PlanStatus {
|
||||
notice: string
|
||||
}
|
||||
export interface ScreenBridge {
|
||||
checkSound: () => Promise<void>
|
||||
selectAudioOutput: (id: string) => Promise<void>
|
||||
prepareAudioOutput: () => Promise<void>
|
||||
planStatus: () => Promise<PlanStatus>
|
||||
|
||||
Reference in New Issue
Block a user