Skip to content

Commit 3d9e353

Browse files
committed
native support remove window2
1 parent 4d9eec6 commit 3d9e353

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/embed/base.ts

+13-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import { logger, setGlobalLogLevelOverride } from '../utils/logger';
1414
import { tokenizedFetch } from '../tokenizedFetch';
1515
import { EndPoints } from '../utils/authService/authService';
1616
import { getThoughtSpotHost } from '../config';
17-
import { AuthType, EmbedConfig, LogLevel, Param, PrefetchFeatures } from '../types';
17+
import {
18+
AuthType, EmbedConfig, LogLevel, Param, PrefetchFeatures,
19+
} from '../types';
1820
import {
1921
authenticate,
2022
logout as _logout,
@@ -60,7 +62,9 @@ export let authPromise: Promise<boolean>;
6062

6163
export const getAuthPromise = (): Promise<boolean> => authPromise;
6264

63-
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout };
65+
export {
66+
notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout,
67+
};
6468

6569
/**
6670
* Perform authentication on the ThoughtSpot app as applicable.
@@ -85,8 +89,7 @@ export const handleAuth = (): Promise<boolean> => {
8589
};
8690

8791
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`,
9093
[PrefetchFeatures.LiveboardEmbed]: (url: string, flags: string) => `${url}?${flags}`,
9194
[PrefetchFeatures.FullApp]: (url: string, flags: string) => `${url}?${flags}`,
9295
[PrefetchFeatures.VizEmbed]: (url: string, flags: string) => `${url}?${flags}`,
@@ -121,9 +124,10 @@ export const prefetch = (
121124
hostUrl = hostUrl[hostUrl.length - 1] === '/' ? hostUrl : `${hostUrl}/`;
122125
Array.from(
123126
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+
)),
127131
),
128132
).forEach((prefetchUrl, index) => {
129133
const iFrame = document.createElement('iframe');
@@ -172,6 +176,7 @@ function backwardCompat(embedConfig: EmbedConfig): EmbedConfig {
172176
* to actually embed. That is handled internally.
173177
* @param embedConfig The configuration object containing ThoughtSpot host,
174178
* authentication mechanism and so on.
179+
* @param isReactNative
175180
* @example
176181
* ```js
177182
* const authStatus = init({
@@ -187,7 +192,7 @@ function backwardCompat(embedConfig: EmbedConfig): EmbedConfig {
187192
*/
188193
export const init = (
189194
embedConfig: EmbedConfig,
190-
isReactNative: boolean = false,
195+
isReactNative = false,
191196
): AuthEventEmitter => {
192197
console.log('is it reac native env? : ', isReactNative);
193198
sanity(embedConfig);

0 commit comments

Comments
 (0)