From 41f38f5bc6ccea75d5eb87fad3e224f118e9a2b1 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Mon, 21 Aug 2023 13:50:38 +0200 Subject: [PATCH] fix: stop media stream on hide When the image capture dialog is hidden, stop the media stream. Didn't work becasue function was executed during setup. --- frappe/public/js/frappe/ui/capture.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/capture.js b/frappe/public/js/frappe/ui/capture.js index adef389099..1d24092f60 100644 --- a/frappe/public/js/frappe/ui/capture.js +++ b/frappe/public/js/frappe/ui/capture.js @@ -98,7 +98,9 @@ frappe.ui.Capture = class { fieldname: "total_count", }, ], - on_hide: this.stop_media_stream(), + on_hide: () => { + this.stop_media_stream(); + }, }); me.$template = $(frappe.ui.Capture.TEMPLATE);