Skip to content

Commit e0006e1

Browse files
authored
Save "Don't show again" setting on splash screen close (#49)
* add * version update * update
1 parent d480911 commit e0006e1

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dynamods/splash-screen",
3-
"version": "1.0.15",
3+
"version": "1.0.16",
44
"description": "Splash Screen maintained by Dynamo Team@Autodesk",
55
"author": "Autodesk Inc.",
66
"license": "MIT",

src/App.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class App extends React.Component {
1515
super();
1616
this.setBackgroundImage();
1717
this.state = {
18+
isChecked: false,
1819
welcomeToDynamoTitle: 'Welcome to Dynamo!',
1920
loadingDone: false,
2021
signInStatus: false
@@ -24,6 +25,12 @@ class App extends React.Component {
2425
window.setLabels = this.setLabels.bind(this);
2526
window.setLoadingDone = this.setLoadingDone.bind(this);
2627
window.setSignInStatus = this.setSignInStatus.bind(this);
28+
this.handleCheckedChange = this.handleCheckedChange.bind(this);
29+
this.closeDynamo = this.closeDynamo.bind(this);
30+
}
31+
32+
handleCheckedChange = (checked) => {
33+
this.setState({isChecked: checked});
2734
}
2835

2936
setBackgroundImage() {
@@ -81,6 +88,7 @@ class App extends React.Component {
8188
showScreenAgainLabel={this.state.showScreenAgainLabel}
8289
importSettingsTitle={this.state.importSettingsTitle}
8390
importSettingsTooltipDescription={this.state.importSettingsTooltipDescription}
91+
onCheckedChange={this.handleCheckedChange}
8492
/> : <Dynamic />
8593
}
8694
</Col>
@@ -127,7 +135,7 @@ class App extends React.Component {
127135

128136
closeDynamo() {
129137
if (chrome.webview !== undefined) {
130-
chrome.webview.hostObjects.scriptObject.CloseWindow();
138+
chrome.webview.hostObjects.scriptObject.CloseWindowPreserve(this.state.isChecked);
131139
}
132140
}
133141
}

src/Static.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@ class Static extends React.Component {
3535
window.setTotalLoadingTime = this.setTotalLoadingTime.bind(this);
3636
window.setEnableSignInButton = this.setEnableSignInButton.bind(this);
3737
window.handleSignInStateChange = this.handleSignInStateChange.bind(this);
38+
this.handleChange = this.handleChange.bind(this)
3839
}
3940

4041
componentDidMount() {
4142
document.addEventListener('keydown', this.handleKeyDown);
4243
}
4344

45+
//Every time the checkbox is clicked, this method is called
46+
handleChange() {
47+
checked = !checked;
48+
this.props.onCheckedChange(checked);
49+
}
50+
4451
render() {
4552
return (
4653
<Container className='pr-3'>
@@ -214,11 +221,6 @@ class Static extends React.Component {
214221
}
215222
}
216223

217-
//Every time the checkbox is clicked, this method is called
218-
handleChange() {
219-
checked = !checked;
220-
}
221-
222224
handleKeyDown = (e) => {
223225
if (e.key === 'Enter') {
224226
// 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

0 commit comments

Comments
 (0)