From f5caa73adaead8503fe2d89f4fe10863055015a1 Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Wed, 29 Nov 2023 19:52:36 -0500 Subject: [PATCH] Sync authentication: Add a method to update sign in button on static screen. (#46) * Update Static.js * Update package.json --- package.json | 2 +- src/Static.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ff67783..5bfcdd5 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Static.js b/src/Static.js index f51ee5a..7c9725d 100644 --- a/src/Static.js +++ b/src/Static.js @@ -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() { @@ -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;