mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-04 19:29:27 -05:00
refac: call overlay styling
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { onMount, tick, getContext, createEventDispatcher } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
import {
|
||||
type Model,
|
||||
@@ -762,10 +763,14 @@
|
||||
}
|
||||
// check if user has access to getUserMedia
|
||||
try {
|
||||
await navigator.mediaDevices.getUserMedia({ audio: true });
|
||||
let stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
||||
// If the user grants the permission, proceed to show the call overlay
|
||||
|
||||
stream.getTracks().forEach((track) => track.stop());
|
||||
stream = null;
|
||||
|
||||
showCallOverlay.set(true);
|
||||
dispatch('call');
|
||||
} catch (err) {
|
||||
// If the user denies the permission or an error occurs, show an error message
|
||||
toast.error($i18n.t('Permission denied when accessing media devices'));
|
||||
|
||||
Reference in New Issue
Block a user