Skip to content

Commit

Permalink
Save "Don't show again" setting on splash screen close (#49)
Browse files Browse the repository at this point in the history
* add

* version update

* update
  • Loading branch information
zeusongit authored Jan 22, 2024
1 parent d480911 commit e0006e1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamods/splash-screen",
"version": "1.0.15",
"version": "1.0.16",
"description": "Splash Screen maintained by Dynamo Team@Autodesk",
"author": "Autodesk Inc.",
"license": "MIT",
Expand Down
10 changes: 9 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class App extends React.Component {
super();
this.setBackgroundImage();
this.state = {
isChecked: false,
welcomeToDynamoTitle: 'Welcome to Dynamo!',
loadingDone: false,
signInStatus: false
Expand All @@ -24,6 +25,12 @@ class App extends React.Component {
window.setLabels = this.setLabels.bind(this);
window.setLoadingDone = this.setLoadingDone.bind(this);
window.setSignInStatus = this.setSignInStatus.bind(this);
this.handleCheckedChange = this.handleCheckedChange.bind(this);
this.closeDynamo = this.closeDynamo.bind(this);
}

handleCheckedChange = (checked) => {
this.setState({isChecked: checked});
}

setBackgroundImage() {
Expand Down Expand Up @@ -81,6 +88,7 @@ class App extends React.Component {
showScreenAgainLabel={this.state.showScreenAgainLabel}
importSettingsTitle={this.state.importSettingsTitle}
importSettingsTooltipDescription={this.state.importSettingsTooltipDescription}
onCheckedChange={this.handleCheckedChange}
/> : <Dynamic />
}
</Col>
Expand Down Expand Up @@ -127,7 +135,7 @@ class App extends React.Component {

closeDynamo() {
if (chrome.webview !== undefined) {
chrome.webview.hostObjects.scriptObject.CloseWindow();
chrome.webview.hostObjects.scriptObject.CloseWindowPreserve(this.state.isChecked);
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/Static.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ class Static extends React.Component {
window.setTotalLoadingTime = this.setTotalLoadingTime.bind(this);
window.setEnableSignInButton = this.setEnableSignInButton.bind(this);
window.handleSignInStateChange = this.handleSignInStateChange.bind(this);
this.handleChange = this.handleChange.bind(this)
}

componentDidMount() {
document.addEventListener('keydown', this.handleKeyDown);
}

//Every time the checkbox is clicked, this method is called
handleChange() {
checked = !checked;
this.props.onCheckedChange(checked);
}

render() {
return (
<Container className='pr-3'>
Expand Down Expand Up @@ -214,11 +221,6 @@ class Static extends React.Component {
}
}

//Every time the checkbox is clicked, this method is called
handleChange() {
checked = !checked;
}

handleKeyDown = (e) => {
if (e.key === 'Enter') {
// We check explicitly the lblImportSettings control due to it's a label that wraps inputs, it's no necessary for the launch and signing buttons because they receive the focus ready to are hit with the Enter key
Expand Down

0 comments on commit e0006e1

Please sign in to comment.