Skip to content

Commit e430112

Browse files
authored
Merge branch 'develop' into greenkeeper/scratch-l10n-3.2.20190417195644
2 parents 5a2bec6 + 7c4d92a commit e430112

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ before_deploy:
2525
if [ -z "$BEFORE_DEPLOY_RAN" ]; then
2626
npm --no-git-tag-version version $RELEASE_VERSION
2727
if [ "$TRAVIS_BRANCH" == "master" ]; then export NPM_TAG=stable; fi
28+
if [[ "$TRAVIS_BRANCH" == hotfix/* ]]; then export NPM_TAG=hotfix; fi # double brackets are important for matching the wildcard
2829
git config --global user.email $(git log --pretty=format:"%ae" -n1)
2930
git config --global user.name $(git log --pretty=format:"%an" -n1)
3031
export BEFORE_DEPLOY_RAN=true
@@ -36,6 +37,7 @@ deploy:
3637
- master
3738
- develop
3839
- smoke
40+
- hotfix/*
3941
condition: $TRAVIS_EVENT_TYPE != cron
4042
skip_cleanup: true
4143
email: $NPM_EMAIL

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"scratch-audio": "0.1.0-prerelease.20190114210212",
108108
"scratch-blocks": "0.1.0-prerelease.1555512815",
109109
"scratch-l10n": "3.2.20190417195644",
110-
"scratch-paint": "0.2.0-prerelease.20190318170811",
110+
"scratch-paint": "0.2.0-prerelease.20190416185326",
111111
"scratch-render": "0.1.0-prerelease.20190326161919",
112112
"scratch-storage": "1.2.2",
113113
"scratch-svg-renderer": "0.2.0-prerelease.20190329052730",

src/containers/backpack.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ class Backpack extends React.Component {
8383
}
8484
handleDrop (dragInfo) {
8585
let payloader = null;
86+
let presaveAsset = null;
8687
switch (dragInfo.dragType) {
8788
case DragConstants.COSTUME:
8889
payloader = costumePayload;
90+
presaveAsset = dragInfo.payload.asset;
8991
break;
9092
case DragConstants.SOUND:
9193
payloader = soundPayload;
94+
presaveAsset = dragInfo.payload.asset;
9295
break;
9396
case DragConstants.SPRITE:
9497
payloader = spritePayload;
@@ -102,6 +105,19 @@ class Backpack extends React.Component {
102105
// Creating the payload is async, so set loading before starting
103106
this.setState({loading: true}, () => {
104107
payloader(dragInfo.payload, this.props.vm)
108+
.then(payload => {
109+
// Force the asset to save to the asset server before storing in backpack
110+
// Ensures any asset present in the backpack is also on the asset server
111+
if (presaveAsset && !presaveAsset.clean) {
112+
return storage.store(
113+
presaveAsset.assetType,
114+
presaveAsset.dataFormat,
115+
presaveAsset.data,
116+
presaveAsset.assetId
117+
).then(() => payload);
118+
}
119+
return payload;
120+
})
105121
.then(payload => saveBackpackObject({
106122
host: this.props.host,
107123
token: this.props.token,

0 commit comments

Comments
 (0)