mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 21:35:19 +00:00
refac
This commit is contained in:
parent
1c518ab688
commit
0ae7d12343
1 changed files with 6 additions and 1 deletions
|
|
@ -54,6 +54,11 @@
|
||||||
}, {});
|
}, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const detectMobile = () => {
|
||||||
|
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||||||
|
return /android|iphone|ipad|ipod|windows phone/i.test(userAgent);
|
||||||
|
};
|
||||||
|
|
||||||
function handleFileChange(event) {
|
function handleFileChange(event) {
|
||||||
const inputFiles = Array.from(event.target?.files);
|
const inputFiles = Array.from(event.target?.files);
|
||||||
if (inputFiles && inputFiles.length > 0) {
|
if (inputFiles && inputFiles.length > 0) {
|
||||||
|
|
@ -148,7 +153,7 @@
|
||||||
: ''}"
|
: ''}"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (fileUploadEnabled) {
|
if (fileUploadEnabled) {
|
||||||
if (!$mobile) {
|
if (!detectMobile()) {
|
||||||
screenCaptureHandler();
|
screenCaptureHandler();
|
||||||
} else {
|
} else {
|
||||||
const cameraInputElement = document.getElementById('camera-input');
|
const cameraInputElement = document.getElementById('camera-input');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue