Skip to content

Commit

Permalink
fix: stop stream on unmount and showCamera is false
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Jan 3, 2025
1 parent d896d8e commit f9f3cc2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/FilesUploader/FilesUploaderArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -383,6 +383,12 @@ function fileIcon(type) {
return FileTextIcon
}
watch(showCamera, (value) => {
if (!value) stopStream()
})
onUnmounted(() => stopStream())
defineExpose({
showFileBrowser,
showWebLink,
Expand Down

0 comments on commit f9f3cc2

Please sign in to comment.