@@ -42,31 +42,15 @@ import systemPreferencesHOC from '../lib/system-preferences-hoc.jsx';
42
42
import GUIComponent from '../components/gui/gui.jsx' ;
43
43
import { setIsScratchDesktop } from '../lib/isScratchDesktop.js' ;
44
44
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
-
57
45
class GUI extends React . Component {
58
46
componentDidMount ( ) {
59
47
setIsScratchDesktop ( this . props . isScratchDesktop ) ;
60
48
this . props . onStorageInit ( storage ) ;
61
49
this . props . onVmInit ( this . props . vm ) ;
62
- setProjectIdMetadata ( this . props . projectId ) ;
63
50
}
64
51
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 ) ;
70
54
}
71
55
if ( this . props . isShowingProject && ! prevProps . isShowingProject ) {
72
56
// this only notifies container when a project changes from not yet loaded to loaded
0 commit comments