Skip to content

Commit 50dd881

Browse files
authored
Merge pull request #336 from smalruby/revert-use-scratch-fetch
Revert use scratch fetch
2 parents f5cec9b + d4a690a commit 50dd881

File tree

3 files changed

+38
-56
lines changed

3 files changed

+38
-56
lines changed

package-lock.json

Lines changed: 34 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"scratch-paint": "2.1.21",
9696
"scratch-render": "0.1.0-prerelease.20230913153807",
9797
"scratch-render-fonts": "1.0.0-prerelease.20221102164332",
98-
"scratch-storage": "2.2.1",
98+
"scratch-storage": "2.1.0",
9999
"scratch-svg-renderer": "0.2.0-prerelease.20230710144521",
100100
"scratch-vm": "github:smalruby/scratch-vm#develop",
101101
"startaudiocontext": "1.2.1",
@@ -123,6 +123,7 @@
123123
"babel-eslint": "10.1.0",
124124
"babel-loader": "8.3.0",
125125
"chromedriver": "117.0.3",
126+
"cross-fetch": "3.1.5",
126127
"dedent": "^0.7.0",
127128
"enzyme": "3.10.0",
128129
"enzyme-adapter-react-16": "1.15.7",

src/containers/gui.jsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,15 @@ import systemPreferencesHOC from '../lib/system-preferences-hoc.jsx';
4242
import GUIComponent from '../components/gui/gui.jsx';
4343
import {setIsScratchDesktop} from '../lib/isScratchDesktop.js';
4444

45-
const {RequestMetadata, setMetadata, unsetMetadata} = storage.scratchFetch;
46-
47-
const setProjectIdMetadata = projectId => {
48-
// If project ID is '0' or zero, it's not a real project ID. In that case, remove the project ID metadata.
49-
// Same if it's null undefined.
50-
if (projectId && projectId !== '0') {
51-
setMetadata(RequestMetadata.ProjectId, projectId);
52-
} else {
53-
unsetMetadata(RequestMetadata.ProjectId);
54-
}
55-
};
56-
5745
class GUI extends React.Component {
5846
componentDidMount () {
5947
setIsScratchDesktop(this.props.isScratchDesktop);
6048
this.props.onStorageInit(storage);
6149
this.props.onVmInit(this.props.vm);
62-
setProjectIdMetadata(this.props.projectId);
6350
}
6451
componentDidUpdate (prevProps) {
65-
if (this.props.projectId !== prevProps.projectId) {
66-
if (this.props.projectId !== null) {
67-
this.props.onUpdateProjectId(this.props.projectId);
68-
}
69-
setProjectIdMetadata(this.props.projectId);
52+
if (this.props.projectId !== prevProps.projectId && this.props.projectId !== null) {
53+
this.props.onUpdateProjectId(this.props.projectId);
7054
}
7155
if (this.props.isShowingProject && !prevProps.isShowingProject) {
7256
// this only notifies container when a project changes from not yet loaded to loaded

0 commit comments

Comments
 (0)