diff --git a/frontend/src/components/FilesUploader/FilesUploaderArea.vue b/frontend/src/components/FilesUploader/FilesUploaderArea.vue index 8768f4e8c..d3585d68c 100644 --- a/frontend/src/components/FilesUploader/FilesUploaderArea.vue +++ b/frontend/src/components/FilesUploader/FilesUploaderArea.vue @@ -128,7 +128,7 @@ import FileAudioIcon from '@/components/Icons/FileAudioIcon.vue' import FileVideoIcon from '@/components/Icons/FileVideoIcon.vue' import { createToast, formatDate, convertSize } from '@/utils' import { FormControl, CircularProgressBar, createResource } from 'frappe-ui' -import { ref, onMounted } from 'vue' +import { ref, onMounted, watch, onUnmounted } from 'vue' const props = defineProps({ doctype: { @@ -383,6 +383,12 @@ function fileIcon(type) { return FileTextIcon } +watch(showCamera, (value) => { + if (!value) stopStream() +}) + +onUnmounted(() => stopStream()) + defineExpose({ showFileBrowser, showWebLink,