Hi, we are developing a web app using pwastater kit and polymer js 3.0,i am
facing an issue once my component is invoked the constructor is calling two
times because of this my login service is calling twice, i am placing my
login component in my-app component. please find the below code snippet of
my login component.
import { LitElement, html } from '@polymer/lit-element';
import { GetLoginJwt } from '../../framework/repository/jwt.repository.js';
import { BindMessageListener } from
'../../framework/services/frame-message-listener.service.js';
import { AppConstants } from '../../framework/constants/app.constants.js';
import { LogInPopUp,IsUserLoggedIn,GetPopUpHtml } from
'../../components/message-popup.component.js';
import {ExceptionHandlerService} from
'../../framework/services/exception-handler.service'
import {ExceptionModel} from
'../../framework/models/exception-data.model.js'
class Login extends LitElement {
render(props) {
return html`
`;
}
static get properties() {
return {
LoginURL: { type: String }
}
}
constructor() {
super();
if(document.getElementById("paperDialogBox")==null){
LogInPopUp();
IsUserLoggedIn().then(status=>{
if(!status){
this.LoginURL = "about:blank";
loginModelPopup.open();
this.GetLoginURL();
}
});
}
}
GetLoginURL() {
this.GenerateLoginUrl();
}
async GenerateLoginUrl() {
var encryptedJwt = '';
await GetLoginJwt().then(data => {
encryptedJwt = data;
});
let appConstants = new AppConstants();
this.LoginURL = appConstants.LoginUrl + encryptedJwt;
loginIframe.setAttribute('src',this.LoginURL);
BindMessageListener();
}
}
window.customElements.define('login-page', Login);
Thanks
Nisanth
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/df3fcd59-719e-4a92-9d78-30d67eee3596%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.