File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
src/app/features/home/explore-tab/explore-tab Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 77
88< ng-template #bubbleIframe >
99 < iframe
10- [src] ="bubbleIframeUrl $ | ngrxPush | safeResourceUrl "
10+ [src] ="bubbleIframeUrlWithJWTToken $ | ngrxPush | safeResourceUrl "
1111 class ="bubble-iframe "
1212 > </ iframe >
1313</ ng-template >
Original file line number Diff line number Diff line change 11import { Component } from '@angular/core' ;
22import { DomSanitizer } from '@angular/platform-browser' ;
3+ import { defer } from 'rxjs' ;
34import { map } from 'rxjs/operators' ;
45import { DiaBackendAuthService } from '../../../../shared/dia-backend/auth/dia-backend-auth.service' ;
56import { BUBBLE_IFRAME_URL } from '../../../../shared/dia-backend/secret' ;
67import { ErrorService } from '../../../../shared/error/error.service' ;
78import { NetworkService } from '../../../../shared/network/network.service' ;
8- import { isNonNullable } from '../../../../utils/rx-operators/rx-operators' ;
99
1010@Component ( {
1111 selector : 'app-explore-tab' ,
1212 templateUrl : './explore-tab.component.html' ,
1313 styleUrls : [ './explore-tab.component.scss' ] ,
1414} )
1515export class ExploreTabComponent {
16- readonly bubbleIframeUrl$ = this . diaBackendAuthService . token$ . pipe (
17- isNonNullable ( ) ,
18- map ( token => {
19- return `${ BUBBLE_IFRAME_URL } /?token=${ token } ` ;
20- } )
21- ) ;
16+ readonly bubbleIframeUrlWithJWTToken$ = defer ( ( ) => {
17+ return this . diaBackendAuthService . queryJWTToken$ ( ) . pipe (
18+ map ( token => {
19+ return `${ BUBBLE_IFRAME_URL } /?token=${ token . access } &refresh_token=${ token . refresh } ` ;
20+ } )
21+ ) ;
22+ } ) ;
2223
2324 readonly networkConnected$ = this . networkService . connected$ ;
2425
You can’t perform that action at this time.
0 commit comments