Update src/serialization/sb3.js
Browse files- src/serialization/sb3.js +6 -4
src/serialization/sb3.js
CHANGED
|
@@ -1474,8 +1474,9 @@ const parseScratchObject = function (object, runtime, extensions, zip, assets) {
|
|
| 1474 |
target.id = object.id;
|
| 1475 |
}
|
| 1476 |
|
| 1477 |
-
if (object.hasOwnProperty('extensionData')) {
|
| 1478 |
-
target.extensionData = object.extensionData;
|
|
|
|
| 1479 |
}
|
| 1480 |
|
| 1481 |
Promise.all(costumePromises).then(costumes => {
|
|
@@ -1665,8 +1666,9 @@ const deserialize = function (json, runtime, zip, isSingleSprite) {
|
|
| 1665 |
if (json.extensionURLs) {
|
| 1666 |
extensions.extensionURLs = new Map(Object.entries(json.extensionURLs));
|
| 1667 |
}
|
| 1668 |
-
if (json.extensionData) {
|
| 1669 |
-
extensions.extensionData = json.extensionData;
|
|
|
|
| 1670 |
}
|
| 1671 |
|
| 1672 |
// Extract any custom fonts before loading costumes.
|
|
|
|
| 1474 |
target.id = object.id;
|
| 1475 |
}
|
| 1476 |
|
| 1477 |
+
if (object.hasOwnProperty('extensionData') || object.hasOwnProperty('extensionStorage')) {
|
| 1478 |
+
target.extensionData = Object.assign(object.extensionStorage ?? {}, object.extensionData);
|
| 1479 |
+
// We're prioritizing the keys in extensionData over the ones in extensionStorage
|
| 1480 |
}
|
| 1481 |
|
| 1482 |
Promise.all(costumePromises).then(costumes => {
|
|
|
|
| 1666 |
if (json.extensionURLs) {
|
| 1667 |
extensions.extensionURLs = new Map(Object.entries(json.extensionURLs));
|
| 1668 |
}
|
| 1669 |
+
if (json.extensionData || json.extensionStorage) {
|
| 1670 |
+
extensions.extensionData = Object.assign(json.extensionStorage ?? {}, json.extensionData);
|
| 1671 |
+
// We're prioritizing the keys in extensionData over the ones in extensionStorage
|
| 1672 |
}
|
| 1673 |
|
| 1674 |
// Extract any custom fonts before loading costumes.
|