Skip to content

Commit c7e4a03

Browse files
committed
Fix disable cloud variables button
Fixes #981 Was probably lost during merge-upstream. That no one noticed until now suggests we could remove this without anyone noticing...
1 parent 0827f8d commit c7e4a03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/cloud-manager-hoc.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ const cloudManagerHOC = function (WrappedComponent) {
8181
props.username &&
8282
props.vm &&
8383
props.projectId &&
84-
props.hasCloudPermission
84+
props.hasCloudPermission &&
85+
!props.cloudVariablesDisabledByUser
8586
);
8687
}
8788
shouldConnect (props) {
@@ -147,6 +148,7 @@ const cloudManagerHOC = function (WrappedComponent) {
147148
canModifyCloudData,
148149
cloudHost,
149150
reduxCloudHost,
151+
cloudVariablesDisabledByUser,
150152
onSetReduxCloudHost,
151153
projectId,
152154
username,
@@ -172,6 +174,7 @@ const cloudManagerHOC = function (WrappedComponent) {
172174
canModifyCloudData: PropTypes.bool.isRequired,
173175
cloudHost: PropTypes.string,
174176
reduxCloudHost: PropTypes.string,
177+
cloudVariablesDisabledByUser: PropTypes.bool.isRequired,
175178
onSetReduxCloudHost: PropTypes.func,
176179
hasCloudPermission: PropTypes.bool,
177180
isShowingWithId: PropTypes.bool.isRequired,
@@ -192,6 +195,7 @@ const cloudManagerHOC = function (WrappedComponent) {
192195
const loadingState = state.scratchGui.projectState.loadingState;
193196
return {
194197
reduxCloudHost: state.scratchGui.tw.cloudHost,
198+
cloudVariablesDisabledByUser: !state.scratchGui.tw.cloud,
195199
isShowingWithId: getIsShowingWithId(loadingState),
196200
projectId: state.scratchGui.projectState.projectId,
197201
// if you're editing someone else's project, you can't modify cloud data

0 commit comments

Comments
 (0)