File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ class Storage extends ScratchStorage {
9494
9595 this . projectToken = creds . token ;
9696 this . username = creds . username ;
97+ // eslint-disable-next-line require-atomic-updates
98+ window . CollaborationUsername = creds . username ;
9799 return creds ;
98100 }
99101 async getProjectToken ( ) {
Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
108108 this . state = {
109109 canSave : false ,
110110 canRemix : false ,
111- canUseCloud : false ,
112111 canEditTitle : false
113112 } ;
114113 }
@@ -168,7 +167,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
168167 storage . setCloudOTT ( data ?. cloudDataOTT ) ;
169168 storage . setCustomAchievements ( data ?. customAchievements ) ;
170169 window . CollaborationRoom = data ?. collaboratorRoom ;
171- window . CollaborationUsername = data ?. username ;
172170 window . collaborationOTT = data ?. collaborationOTT ;
173171 }
174172 setIndexable ( true ) ;
@@ -199,7 +197,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
199197 { ...props }
200198 canSave = { this . state . canSave }
201199 canRemix = { this . state . canRemix }
202- canUseCloud = { this . state . canUseCloud }
203200 canEditTitle = { this . state . canEditTitle }
204201 />
205202 ) ;
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ const vmManagerHOC = function (WrappedComponent) {
3838 class VMManager extends React . Component {
3939 constructor ( props ) {
4040 super ( props ) ;
41+ this . state = {
42+ canUseCloud : false
43+ } ;
4144 bindAll ( this , [
4245 'loadProject'
4346 ] ) ;
@@ -92,6 +95,10 @@ const vmManagerHOC = function (WrappedComponent) {
9295 const username = storage . username || '' ;
9396 this . props . onSetUsername ( username ) ;
9497
98+ if ( username !== '' ) {
99+ this . setState ( { canUseCloud : true } ) ;
100+ }
101+
95102 this . props . vm . loadProject ( this . props . projectData , additionalData )
96103 . then ( ( ) => {
97104 this . props . onLoadedProject ( this . props . loadingState , this . props . canSave ) ;
@@ -139,6 +146,7 @@ const vmManagerHOC = function (WrappedComponent) {
139146 < WrappedComponent
140147 isLoading = { isLoadingWithIdProp }
141148 vm = { vm }
149+ canUseCloud = { this . state . canUseCloud }
142150 { ...componentProps }
143151 />
144152 ) ;
You can’t perform that action at this time.
0 commit comments