mirror of
https://github.com/open-webui/open-webui
synced 2025-03-16 02:17:33 +00:00
refac: permission
This commit is contained in:
parent
508e8eb4b1
commit
f92ef3211b
@ -896,11 +896,20 @@
|
|||||||
<button
|
<button
|
||||||
class=" text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-850 transition rounded-full p-2 self-center"
|
class=" text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-850 transition rounded-full p-2 self-center"
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => {
|
on:click={async () => {
|
||||||
if (selectedModels.length > 1) {
|
if (selectedModels.length > 1) {
|
||||||
toast.error($i18n.t('Select only one model to call'));
|
toast.error($i18n.t('Select only one model to call'));
|
||||||
} else {
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// check if user has access to getUserMedia
|
||||||
|
try {
|
||||||
|
await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
|
||||||
|
// If the user grants the permission, proceed to show the call overlay
|
||||||
showCallOverlay.set(true);
|
showCallOverlay.set(true);
|
||||||
|
} 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'));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user