Remove private skin access logic from GUI
As the unshared project situation has been resolved, we can move our logic into scratch-vm instead.
This commit is contained in:
1 parent
61d0742a32
commit
3cb3e89d76
3 files changed
+2
-15
No files matched your search
@@ -118,7 +118,6 @@ const ProjectFetcherHOC = function (WrappedComponent) {
|
||||
}
|
||||
assetPromise = progressMonitor.fetchWithProgress(projectUrl)
|
||||
.then(r => {
|
||||
this.props.vm.runtime.renderer.setPrivateSkinAccess(false);
|
||||
if (!r.ok) {
|
||||
throw new Error(`Request returned status ${r.status}`);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
|
||||
}
|
||||
componentDidUpdate () {
|
||||
// project title resetting is handled in titled-hoc.jsx
|
||||
this.props.vm.runtime.renderer.setPrivateSkinAccess(true);
|
||||
this.props.onSetAuthor('', '');
|
||||
this.props.onSetDescription('', '');
|
||||
const projectId = this.props.projectId;
|
||||
@@ -83,7 +82,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
|
||||
setIndexable(true);
|
||||
})
|
||||
.catch(err => {
|
||||
this.props.vm.runtime.renderer.setPrivateSkinAccess(false);
|
||||
setIndexable(false);
|
||||
if (`${err}`.includes('unshared')) {
|
||||
this.props.onSetDescription('unshared', 'unshared');
|
||||
@@ -98,7 +96,6 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
|
||||
onSetAuthor,
|
||||
onSetDescription,
|
||||
onSetProjectTitle,
|
||||
vm,
|
||||
/* eslint-enable no-unused-vars */
|
||||
...props
|
||||
} = this.props;
|
||||
@@ -113,18 +110,10 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
|
||||
projectId: PropTypes.string,
|
||||
onSetAuthor: PropTypes.func,
|
||||
onSetDescription: PropTypes.func,
|
||||
onSetProjectTitle: PropTypes.func,
|
||||
vm: PropTypes.shape({
|
||||
runtime: PropTypes.shape({
|
||||
renderer: PropTypes.shape({
|
||||
setPrivateSkinAccess: PropTypes.func
|
||||
})
|
||||
})
|
||||
})
|
||||
onSetProjectTitle: PropTypes.func
|
||||
};
|
||||
const mapStateToProps = state => ({
|
||||
projectId: state.scratchGui.projectState.projectId,
|
||||
vm: state.scratchGui.vm
|
||||
projectId: state.scratchGui.projectState.projectId
|
||||
});
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
onSetAuthor: (username, thumbnail) => dispatch(setAuthor({
|
||||
|
||||
@@ -35,7 +35,6 @@ let vm;
|
||||
|
||||
const onVmInit = _vm => {
|
||||
vm = _vm;
|
||||
vm.runtime.renderer.setPrivateSkinAccess(false);
|
||||
};
|
||||
|
||||
const onProjectLoaded = () => {
|
||||
|
||||
Reference in new issue
Block a user