-
Notifications
You must be signed in to change notification settings - Fork 70
feat(user-state): load and change state, client timer #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
77407eb
5433cbc
9e8d9e7
d8db768
6d3ae52
29bbc95
a040792
c25f8ca
7724850
cb29987
8336229
74d9057
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| const widgetsContainer = document.getElementById('widgets-container'); | ||
| const accessTokenElem = document.getElementById('access_token_elem'); | ||
| const widgetsContainer = document.getElementById('widgets-container'); | ||
| const ccStationLogin = document.getElementById('cc-station-login'); | ||
| const ccUserState = document.createElement('widget-cc-user-state'); | ||
|
|
||
| if (!ccStationLogin && !ccUserState) { | ||
| console.error('Failed to find the required elements'); | ||
| } | ||
|
|
||
| function switchButtonState(){ | ||
| const buttonElem = document.querySelector('button'); | ||
|
|
@@ -20,16 +25,19 @@ function initWidgets(){ | |
| }).then(() => { | ||
| ccStationLogin.onLogin = loginSuccess; | ||
| ccStationLogin.onLogout = logoutSuccess; | ||
| widgetsContainer.classList.remove('disabled'); | ||
| ccStationLogin.classList.remove('disabled'); | ||
| }).catch((error) => { | ||
| console.error('Failed to initialize widgets:', error); | ||
| }); | ||
| } | ||
|
|
||
| function loginSuccess(){ | ||
| console.log('Agent login has been succesful'); | ||
| ccUserState.classList.remove('disabled'); | ||
|
Comment on lines
35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace console logs with proper logging utility. Production code should use a proper logging utility instead of console.log/error. Consider using the logger from webexConfig: function loginSuccess(){
- console.log('Agent login has been succesful');
+ webexConfig.logger.log('Agent login has been succesful');
ccUserState.classList.remove('disabled');
}
function logoutSuccess(){
- console.log('Agent logout has been succesful');
+ webexConfig.logger.log('Agent logout has been succesful');
ccUserState.classList.add('disabled');
}Also applies to: 35-36
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a sample app change. Not going to do it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mkesavan13, understood. Since this is a sample app change, it's acceptable to use ✏️ Learnings added
|
||
| widgetsContainer.appendChild(ccUserState); | ||
| } | ||
|
|
||
| function logoutSuccess(){ | ||
| console.log('Agent logout has been succesful'); | ||
| ccUserState.classList.add('disabled'); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.