Skip to content

Commit

Permalink
YDA-5889: fix for UTF8 warningfor new files
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidastri authored Aug 28, 2024
1 parent e897234 commit 53f74c8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions research/static/research/js/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -408,14 +416,6 @@ $(function () {
$self.find('.msg').html('<i class="fa-solid fa-spinner fa-spin fa-fw"></i>')
})

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()
Expand Down

0 comments on commit 53f74c8

Please sign in to comment.