@@ -14,7 +14,9 @@ import { logger, setGlobalLogLevelOverride } from '../utils/logger';
14
14
import { tokenizedFetch } from '../tokenizedFetch' ;
15
15
import { EndPoints } from '../utils/authService/authService' ;
16
16
import { getThoughtSpotHost } from '../config' ;
17
- import { AuthType , EmbedConfig , LogLevel , Param , PrefetchFeatures } from '../types' ;
17
+ import {
18
+ AuthType , EmbedConfig , LogLevel , Param , PrefetchFeatures ,
19
+ } from '../types' ;
18
20
import {
19
21
authenticate ,
20
22
logout as _logout ,
@@ -60,7 +62,9 @@ export let authPromise: Promise<boolean>;
60
62
61
63
export const getAuthPromise = ( ) : Promise < boolean > => authPromise ;
62
64
63
- export { notifyAuthFailure , notifyAuthSDKSuccess , notifyAuthSuccess , notifyLogout } ;
65
+ export {
66
+ notifyAuthFailure , notifyAuthSDKSuccess , notifyAuthSuccess , notifyLogout ,
67
+ } ;
64
68
65
69
/**
66
70
* Perform authentication on the ThoughtSpot app as applicable.
@@ -85,8 +89,7 @@ export const handleAuth = (): Promise<boolean> => {
85
89
} ;
86
90
87
91
const hostUrlToFeatureUrl = {
88
- [ PrefetchFeatures . SearchEmbed ] : ( url : string , flags : string ) =>
89
- `${ url } v2/?${ flags } #/embed/answer` ,
92
+ [ PrefetchFeatures . SearchEmbed ] : ( url : string , flags : string ) => `${ url } v2/?${ flags } #/embed/answer` ,
90
93
[ PrefetchFeatures . LiveboardEmbed ] : ( url : string , flags : string ) => `${ url } ?${ flags } ` ,
91
94
[ PrefetchFeatures . FullApp ] : ( url : string , flags : string ) => `${ url } ?${ flags } ` ,
92
95
[ PrefetchFeatures . VizEmbed ] : ( url : string , flags : string ) => `${ url } ?${ flags } ` ,
@@ -121,9 +124,10 @@ export const prefetch = (
121
124
hostUrl = hostUrl [ hostUrl . length - 1 ] === '/' ? hostUrl : `${ hostUrl } /` ;
122
125
Array . from (
123
126
new Set (
124
- features . map ( ( feature ) =>
125
- hostUrlToFeatureUrl [ feature ] ( hostUrl , getQueryParamString ( prefetchFlags ) ) ,
126
- ) ,
127
+ features . map ( ( feature ) => hostUrlToFeatureUrl [ feature ] (
128
+ hostUrl ,
129
+ getQueryParamString ( prefetchFlags ) ,
130
+ ) ) ,
127
131
) ,
128
132
) . forEach ( ( prefetchUrl , index ) => {
129
133
const iFrame = document . createElement ( 'iframe' ) ;
@@ -172,6 +176,7 @@ function backwardCompat(embedConfig: EmbedConfig): EmbedConfig {
172
176
* to actually embed. That is handled internally.
173
177
* @param embedConfig The configuration object containing ThoughtSpot host,
174
178
* authentication mechanism and so on.
179
+ * @param isReactNative
175
180
* @example
176
181
* ```js
177
182
* const authStatus = init({
@@ -187,7 +192,7 @@ function backwardCompat(embedConfig: EmbedConfig): EmbedConfig {
187
192
*/
188
193
export const init = (
189
194
embedConfig : EmbedConfig ,
190
- isReactNative : boolean = false ,
195
+ isReactNative = false ,
191
196
) : AuthEventEmitter => {
192
197
console . log ( 'is it reac native env? : ' , isReactNative ) ;
193
198
sanity ( embedConfig ) ;
0 commit comments