soiz1 commited on
Commit
565d82f
·
verified ·
1 Parent(s): 3e6059a

Update src/components/menu-bar/google-drive-save.jsx

Browse files
src/components/menu-bar/google-drive-save.jsx CHANGED
@@ -15,7 +15,7 @@ class GoogleDriveSave extends React.Component {
15
  files: [],
16
  isModalOpen: false,
17
  isLoading: false,
18
- newFileName: window.vm.runtime.projectName || '無題',
19
  showNewFileInput: false
20
  };
21
  this.modalContentRef = React.createRef();
@@ -513,7 +513,11 @@ class GoogleDriveSave extends React.Component {
513
 
514
  GoogleDriveSave.propTypes = {
515
  className: PropTypes.string,
516
- showAlert: PropTypes.func.isRequired
 
517
  };
 
 
 
518
 
519
- export default GoogleDriveSave;
 
15
  files: [],
16
  isModalOpen: false,
17
  isLoading: false,
18
+ newFileName: this.props.projectTitle || '無題',
19
  showNewFileInput: false
20
  };
21
  this.modalContentRef = React.createRef();
 
513
 
514
  GoogleDriveSave.propTypes = {
515
  className: PropTypes.string,
516
+ showAlert: PropTypes.func.isRequired,
517
+ projectTitle: PropTypes.string
518
  };
519
+ const mapStateToProps = state => ({
520
+ projectTitle: state.scratchGui.projectTitle
521
+ });
522
 
523
+ export default connect(mapStateToProps)(GoogleDriveSave);