Skip to content

Commit 5c6359a

Browse files
fix removing of existing blocks on sound sample drop
1 parent f30131e commit 5c6359a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

js/activity.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ class Activity {
29482948
[7, "hidden", 0, 0, [1, null]],
29492949
[8, "hiddennoflow", 0, 0, [0, null]]
29502950
];
2951-
return samplerStack;
2951+
this.blocks.loadNewBlocks(samplerStack);
29522952
};
29532953

29542954
/*
@@ -6490,6 +6490,8 @@ class Activity {
64906490
that.errorMsg(
64916491
_("Cannot load project from the file. Please check the file type.")
64926492
);
6493+
} else if (files[0].type === "audio/wav") {
6494+
this.makeSamplerWidget(files[0].name, reader.result);
64936495
} else {
64946496
const cleanData = rawData.replace("\n", " ");
64956497
let obj;
@@ -6499,9 +6501,6 @@ class Activity {
64996501
cleanData.match('<div class="code">(.+?)</div>')[1]
65006502
);
65016503
}
6502-
else if (files[0].type === "audio/wav") {
6503-
obj = this.makeSamplerWidget(files[0].name, reader.result);
6504-
}
65056504
else {
65066505
obj = JSON.parse(cleanData);
65076506
}

0 commit comments

Comments
 (0)