Victor Bjorn
11/11/2025, 1:31 PMprivate async loadScriptAsModule(url: string, id: string): Promise<any> {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.type = 'module';
script.src = url;
script.id = id;
script.onload = async () => {
try {
const module = await window.eval(`import('${url}')`);
resolve(module);
} catch (err) {
reject(err);
}
};
script.onerror = reject;
document.head.appendChild(script);
});
}
Authentication setup:
private setupGDBackend() {
if(!this.gdBackend) {
console.log("setting up tiger backend");
this.gdBackend = tigerFactory()
.onHostname(this.apiService.getGoodDataBaseUrl())
.withAuthentication(
new TigerJwtAuthProvider(this.token,
this.notAuthHandler,
this.jwtIsAboutToExpiryHandler,
10)
);
}
}
That's how I set the context:
this.workspaceModule.setContext({
backend: this.gdBackend,
workspaceId: workspaceId,
});
I tried to remove the loaded workspace A script and load the proper workspace B script and set the context again, but it hasn't helped.
Could you please advise how to correctly re-initialize or reset the context when switching workspaces?
Thank you!kapa.ai
11/11/2025, 1:32 PM