@@ -27,7 +27,7 @@ import {
27
27
OIDCEndpoints ,
28
28
User ,
29
29
} from '@asgardeo/javascript' ;
30
- // import WorkerFile from '../worker';
30
+ import WorkerFile from '../web. worker' ;
31
31
import { MainThreadClient , WebWorkerClient } from './clients' ;
32
32
import { Hooks , REFRESH_ACCESS_TOKEN_ERR0R } from './constants' ;
33
33
import { AuthenticationHelper , SPAHelper } from './helpers' ;
@@ -70,8 +70,7 @@ export class AsgardeoSPAClient {
70
70
protected _client : WebWorkerClientInterface | MainThreadClientInterface | undefined ;
71
71
protected _storage : BrowserStorage | undefined ;
72
72
protected _authHelper : typeof AuthenticationHelper = AuthenticationHelper ;
73
- // protected _worker: new () => Worker = WorkerFile;
74
- protected _worker = null ;
73
+ protected _worker : new ( ) => Worker = WorkerFile ;
75
74
protected _initialized : boolean = false ;
76
75
protected _startedInitialize : boolean = false ;
77
76
protected _onSignInCallback : ( response : User ) => void = ( ) => null ;
@@ -94,13 +93,13 @@ export class AsgardeoSPAClient {
94
93
}
95
94
}
96
95
97
- // public instantiateWorker(worker: new () => Worker) {
98
- // if (worker) {
99
- // this._worker = worker;
100
- // } else {
101
- // this._worker = WorkerFile;
102
- // }
103
- // }
96
+ public instantiateWorker ( worker : new ( ) => Worker ) {
97
+ if ( worker ) {
98
+ this . _worker = worker ;
99
+ } else {
100
+ this . _worker = WorkerFile ;
101
+ }
102
+ }
104
103
105
104
/**
106
105
* This method specifies if the `AsgardeoSPAClient` has been initialized or not.
@@ -239,7 +238,7 @@ export class AsgardeoSPAClient {
239
238
this . _startedInitialize = true ;
240
239
241
240
authHelper && this . instantiateAuthHelper ( authHelper ) ;
242
- // workerFile && this.instantiateWorker(workerFile);
241
+ workerFile && this . instantiateWorker ( workerFile ) ;
243
242
244
243
const _config = await this . _client ?. getConfigData ( ) ;
245
244
0 commit comments