Skip to content

Commit 81639d8

Browse files
committed
Revert "feat: use scratchFetch"
This reverts commit 76f869b.
1 parent 74bb119 commit 81639d8

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

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)