Skip to content

Commit

Permalink
Fix duplicate call to myself
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Sep 5, 2024
1 parent 3b8d3fa commit ccdcb1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web-app/src/app/map/controls/export.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button mat-mini-fab color="default" matTooltip="Filter" matTooltipPosition="after" (click)="onClick($event)">
<button mat-mini-fab color="default" matTooltip="Export" matTooltipPosition="after" (click)="onClick($event)">
<mat-icon color="primary">file_download</mat-icon>
</button>
16 changes: 8 additions & 8 deletions web-app/src/app/user/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpClient, HttpContext, HttpEvent } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { Router } from '@angular/router'
import { Observable, Subject } from 'rxjs'
import { Observable, Subject, tap } from 'rxjs'
import { LocalStorageService } from '../http/local-storage.service'
import { BYPASS_TOKEN } from '../http/token.interceptor'
import { User } from 'core-lib-src/user'
Expand Down Expand Up @@ -96,13 +96,13 @@ export class UserService {
}

getMyself(): Observable<any> {
const observable = this.httpClient.get<any>('/api/users/myself')

observable.subscribe((user: any) => {
this.setUser(user)
})

return observable
return this.httpClient
.get<any>('/api/users/myself')
.pipe(
tap((user: any) => {
this.setUser(user)
}),
)
}

setUser(user: any) {
Expand Down

0 comments on commit ccdcb1e

Please sign in to comment.