From 045d44307217bdbd4ba326b3524ce9f631ec4a35 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 2 Jun 2024 08:47:08 +0300 Subject: [PATCH] fix webtorrent file selection event --- js/interface_home.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/interface_home.js b/js/interface_home.js index 3e9c9dc..3bec05e 100644 --- a/js/interface_home.js +++ b/js/interface_home.js @@ -390,12 +390,10 @@ function initWebTorrent() { } } } - // setup attach button $(".post-area-attach").show(); - var fileInput = $("#fileInputAttach"); - fileInput.on('change', function(event) { - var file = fileInput[0].files[0]; + $(document).on("change", "#fileInputAttach", function(event) { + var file = event.target.files[0]; var seedingTorrent = undefined; for (var i = 0; i < WebTorrentClient.torrents.length; i++) { var torrent = WebTorrentClient.torrents[i];