Skip to content

Commit

Permalink
Sync authentication: Add a method to update sign in button on static …
Browse files Browse the repository at this point in the history
…screen. (#46)

* Update Static.js

* Update package.json
  • Loading branch information
zeusongit authored Nov 30, 2023
1 parent e9ec865 commit f5caa73
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
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.13",
"version": "1.0.14",
"description": "Splash Screen maintained by Dynamo Team@Autodesk",
"author": "Autodesk Inc.",
"license": "MIT",
Expand Down
16 changes: 16 additions & 0 deletions src/Static.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Static extends React.Component {
window.setImportStatus = this.setImportStatus.bind(this);
window.setTotalLoadingTime = this.setTotalLoadingTime.bind(this);
window.setEnableSignInButton = this.setEnableSignInButton.bind(this);
window.handleSignInStateChange = this.handleSignInStateChange.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -191,6 +192,21 @@ class Static extends React.Component {
}
}

//Handles changes to auth status on splash screen
handleSignInStateChange(auth) {
let btn = document.getElementById('btnSignIn');

this.setState({
signInStatus:auth.status === 'True'
});

if (auth.status === 'True'){
btn.innerHTML = this.props.signOutTitle
}else{
btn.innerHTML = this.props.signInTitle
}
}

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

0 comments on commit f5caa73

Please sign in to comment.