FIx #2720 Open Parent & Adopt Textures still does an action when dismissing dialog

This commit is contained in:
JannisX11 2025-03-16 23:23:03 +01:00
parent 095ed3ef76
commit e36c119082
3 changed files with 5 additions and 3 deletions

View File

@ -535,6 +535,8 @@ window.MessageBox = class MessageBox extends Dialog {
super(options.id, options);
this.options = options;
if (!options.buttons) this.buttons = ['dialog.ok'];
this.cancelIndex = Math.min(this.buttons.length-1, this.cancelIndex);
this.confirmIndex = Math.min(this.buttons.length-1, this.confirmIndex);
this.callback = callback;
}
close(button, result, event) {

View File

@ -453,7 +453,7 @@ var codec = new Codec('java_block', {
open_with_textures: {text: 'message.child_model_only.open_with_textures', condition: Texture.all.length > 0}
}
}, (result) => {
if (result) {
if (typeof result == 'string') {
let parent = model.parent.replace(/\w+:/, '');
let path_arr = path.split(osfs);
let index = path_arr.length - path_arr.indexOf('models');

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "Blockbench",
"version": "4.12.1",
"version": "4.12.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "Blockbench",
"version": "4.12.1",
"version": "4.12.3",
"license": "GPL-3.0-or-later",
"dependencies": {
"@electron/remote": "^2.1.2",