Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidastri committed Aug 28, 2024
1 parent e897234 commit 2487364
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 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 @@ -385,6 +393,7 @@ $(function () {
overwrite = true
}
}

// Check for apostrophe in folder name
if (folders.indexOf('\'') > -1) {
// It seems like you must first pause, then cancel
Expand All @@ -408,14 +417,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 2487364

Please sign in to comment.