From 53f74c85250b4350b5b11333ad0cd9242af9096f Mon Sep 17 00:00:00 2001 From: Leonidas Triantafyllou Date: Wed, 28 Aug 2024 10:10:10 +0200 Subject: [PATCH] YDA-5889: fix for UTF8 warningfor new files --- research/static/research/js/research.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/research/static/research/js/research.js b/research/static/research/js/research.js index a64c9950..c4876ede 100644 --- a/research/static/research/js/research.js +++ b/research/static/research/js/research.js @@ -348,6 +348,14 @@ $(function () { const folderName = file.relativePath.substring(0, file.relativePath.indexOf('/')) let overwrite = false + try { + decodeURIComponent(escape(file.name)) + } catch (e) { + if ($('#nonUTF-8FilenameWarning').hasClass('hidden')) { + $('#nonUTF-8FilenameWarning').removeClass('hidden') + } + } + const $self = $('#' + file.uniqueIdentifier) // Pause btn $self.find('.upload-pause').on('click', function () { @@ -408,14 +416,6 @@ $(function () { $self.find('.msg').html('') }) - try { - decodeURIComponent(escape(file.name)) - } catch (e) { - if ($('#nonUTF-8FilenameWarning').hasClass('hidden')) { - $('#nonUTF-8FilenameWarning').removeClass('hidden') - } - } - // No Overwrite btn $self.find('.upload-no-overwrite').on('click', function () { file.cancel()