From 9fce77c389b17e50b7da6f8a0bb083547fb2f7ee Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sat, 29 Jul 2023 17:22:58 +0200 Subject: [PATCH] Fix #1970 issue drag and dropping skin file --- js/interface/dialog.js | 7 +++++-- js/io/io.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/interface/dialog.js b/js/interface/dialog.js index 7377664a..4e86b093 100644 --- a/js/interface/dialog.js +++ b/js/interface/dialog.js @@ -614,12 +614,15 @@ window.Dialog = class Dialog { break; case 'file': delete data.file; - if (isApp) { + if (data.return_as == 'file' && typeof value == 'object') { + data.file = value; + data.value = data.file.name; + } else if (isApp) { data.value = value; } else { data.content = value; } - data.bar.find('input').val(settings.streamer_mode.value ? `[${tl('generic.redacted')}]` : value); + data.bar.find('input').val(settings.streamer_mode.value ? `[${tl('generic.redacted')}]` : data.value); break; } } diff --git a/js/io/io.js b/js/io/io.js index 3b412d67..9c4d90ac 100644 --- a/js/io/io.js +++ b/js/io/io.js @@ -155,7 +155,7 @@ async function loadImages(files, event) { } else if (method == 'minecraft_skin') { Formats.skin.setup_dialog.show(); Formats.skin.setup_dialog.setFormValues({ - texture: isApp ? files[0].path : files[0].content + texture: files[0] }) } else if (method == 'extrude_with_cubes') {