Hello @ashish,
We are embedding TS using the token-based method, and if the token is invalid or not set, then the embedded screen displays the "Not logged in" text in the top right corner(see attached).
Can we customize the text and its style if the token is invalid or not set?
Below is the code, we are using to initialize TS and display contents.
async function initializeThoughtSpot() {
try {
init({
thoughtSpotHost: "",
authType: AuthType.TrustedAuthTokenCookieless,
getAuthToken: () => {
return 'token';
},
callPreFetch: true
});
login_ts();
} catch (error) {
console.error('Error occurred while initializing ThoughtSpot:', error);
}
}
function login_ts(){
const lb = new AppEmbed('#ts-embed', {
frameParams: {
height: '100vh',
},
pageId: Page.Pinboards,
});
lb.render();
hideNoDataImage();
showErrorBanner('none');
function setDisplayStyle(el, style) {
alert(el);
if(document.getElementById(el)) {
document.getElementById(el).style.display = style;
}
}
function showErrorBanner(display, errorText) {
setDisplayStyle("loader", "block");
if(errorText) {
document.getElementById("errorBanner").firstElementChild.innerText = errorText;
}else{
document.getElementById("errorBanner").firstElementChild.innerText = 'Hello';
}
}
}
window.addEventListener('load', function() {
initializeThoughtSpot();
});
Thanks,
CC: @Sandeep, @shikharTS