Skip to content

Commit

Permalink
Setting preparation method not as method, rather as variable. fixing …
Browse files Browse the repository at this point in the history
…scrolling issues.
  • Loading branch information
graphefruit committed Dec 21, 2023
1 parent 2ee9cd5 commit 4d80554
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="ion-title ion-padding-top">{{"PRESET_BREW_TITLE" | translate }}</span>
</ion-item>

<ion-item *ngFor="let prep of getPreparationMethods();let last = last" detail="true" (click)="choosePreparation(prep)" lines="{{last?'none':''}}" tappable>
<ion-item *ngFor="let prep of preparationMethods;let last = last" detail="true" (click)="choosePreparation(prep)" lines="{{last?'none':''}}" tappable>
{{prep.name}}<span style='font-size: 12px; margin-top: 2px;'>&nbsp;({{"LAST_USE" | translate}}:
<span *ngIf="getBrewsCount(prep)> 0">{{lastUsed(prep) | formatDate:["DD.MM.YYYY"]}}</span>
<span *ngIf="getBrewsCount(prep) <= 0">-</span>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { UIHelper } from '../../../services/uiHelper';
export class BrewChoosePreparationToBrewComponent implements OnInit {
public static COMPONENT_ID: string = 'brew-choose-preparation-to-brew';

public preparationMethods: Array<Preparation> = [];

constructor(
private readonly modalController: ModalController,
private readonly uiBrewStorage: UIBrewStorage,
Expand All @@ -24,7 +26,9 @@ export class BrewChoosePreparationToBrewComponent implements OnInit {
private readonly uiHelper: UIHelper
) {}

public ngOnInit() {}
public ngOnInit() {
this.preparationMethods = this.getPreparationMethods();
}

public getPreparationMethods(): Array<Preparation> {
const allEntries = this.uiPreparationStorage
Expand Down

0 comments on commit 4d80554

Please sign in to comment.