@@ -196,11 +196,24 @@ const ProjectSaverHOC = function (WrappedComponent) {
196196 }
197197 createRemixToStorage ( ) {
198198 this . props . onShowCreatingRemixAlert ( ) ;
199- return this . storeProject ( null , {
199+ const requestParams = {
200200 originalId : this . props . reduxProjectId ,
201201 isRemix : 1 ,
202202 title : this . props . reduxProjectTitle
203- } )
203+ } ;
204+ if ( this . props . isScratchProject ) {
205+ requestParams . source = 'scratch' ;
206+
207+ // Mark all assets as dirty so storeProject() will upload them
208+ // to the CodeTorch S3/Backend instead of relying on Scratch CDNs
209+ // originally we were going to optimize and load from Scratch CDN until user modifies
210+ // but with how bad Scratch has been this is safer
211+ this . props . vm . assets . forEach ( asset => {
212+ asset . clean = false ;
213+ } ) ;
214+ }
215+
216+ return this . storeProject ( null , requestParams )
204217 . then ( response => {
205218 this . props . onCreatedProject ( response . id . toString ( ) , this . props . loadingState ) ;
206219 this . props . onShowRemixSuccessAlert ( ) ;
@@ -367,6 +380,7 @@ const ProjectSaverHOC = function (WrappedComponent) {
367380 isRemixing : PropTypes . bool ,
368381 isShared : PropTypes . bool ,
369382 isShowingSaveable : PropTypes . bool ,
383+ isScratchProject : PropTypes . bool ,
370384 isShowingWithId : PropTypes . bool ,
371385 isShowingWithoutId : PropTypes . bool ,
372386 isUpdating : PropTypes . bool ,
@@ -424,7 +438,8 @@ const ProjectSaverHOC = function (WrappedComponent) {
424438 projectChanged : state . scratchGui . projectChanged ,
425439 reduxProjectId : state . scratchGui . projectState . projectId ,
426440 reduxProjectTitle : state . scratchGui . projectTitle ,
427- vm : state . scratchGui . vm
441+ vm : state . scratchGui . vm ,
442+ isScratchProject : state . scratchGui . projectState . isScratchProject
428443 } ;
429444 } ;
430445 const mapDispatchToProps = dispatch => ( {
0 commit comments