Bugfix/change show condition of button to fetch current market price (#3079)

* Change show condition of button to fetch current market price

* Update changelog
pull/3084/head
Thomas Kaul 9 months ago committed by GitHub
parent 7f67430685
commit 66992ef915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed a missing value in the activities table on mobile - Fixed a missing value in the activities table on mobile
- Displayed the button to fetch the current market price only if the activity is from today
## 2.59.0 - 2024-02-29 ## 2.59.0 - 2024-02-29

@ -20,6 +20,7 @@ import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { AssetClass, AssetSubClass, Tag, Type } from '@prisma/client'; import { AssetClass, AssetSubClass, Tag, Type } from '@prisma/client';
import { isUUID } from 'class-validator'; import { isUUID } from 'class-validator';
import { isToday } from 'date-fns';
import { EMPTY, Observable, Subject, lastValueFrom, of } from 'rxjs'; import { EMPTY, Observable, Subject, lastValueFrom, of } from 'rxjs';
import { catchError, delay, map, startWith, takeUntil } from 'rxjs/operators'; import { catchError, delay, map, startWith, takeUntil } from 'rxjs/operators';
@ -48,6 +49,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
public defaultDateFormat: string; public defaultDateFormat: string;
public filteredTagsObservable: Observable<Tag[]> = of([]); public filteredTagsObservable: Observable<Tag[]> = of([]);
public isLoading = false; public isLoading = false;
public isToday = isToday;
public platforms: { id: string; name: string }[]; public platforms: { id: string; name: string }[];
public separatorKeysCodes: number[] = [ENTER, COMMA]; public separatorKeysCodes: number[] = [ENTER, COMMA];
public tags: Tag[] = []; public tags: Tag[] = [];

@ -240,7 +240,8 @@
<button <button
*ngIf=" *ngIf="
currentMarketPrice && currentMarketPrice &&
(data.activity.type === 'BUY' || data.activity.type === 'SELL') (data.activity.type === 'BUY' || data.activity.type === 'SELL') &&
isToday(activityForm.controls['date']?.value)
" "
class="ml-2 mt-1 no-min-width" class="ml-2 mt-1 no-min-width"
mat-button mat-button

Loading…
Cancel
Save