Skip to content

Commit

Permalink
fix: fix some wording
Browse files Browse the repository at this point in the history
  • Loading branch information
artaommahe committed Sep 1, 2024
1 parent 1894a95 commit eabbb0e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/app/barn/barn.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class BarnService {

const count = seed.count + newSeeds[seed.name];

if (count >= seedPlantingTreshold) {
if (count >= seedToCardTreshold) {
return { ...result, newCards: [...result.newCards, seed.name] };
}

Expand Down Expand Up @@ -117,4 +117,4 @@ export class BarnService {
}
}

const seedPlantingTreshold = 5;
const seedToCardTreshold = 5;
6 changes: 3 additions & 3 deletions src/app/cards/cards-list/cards-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export class CardsListComponent {
showDetails = output<string>();

sortedCards = computed(() => this.cards().toSorted((a, b) => b.addedAt.localeCompare(a.addedAt)));
newCards = computed(() => this.sortedCards().slice(0, newCardsAmount));
restCards = computed(() => this.sortedCards().slice(newCardsAmount));
newCards = computed(() => this.sortedCards().slice(0, newCardsCount));
restCards = computed(() => this.sortedCards().slice(newCardsCount));
}

const newCardsAmount = 10;
const newCardsCount = 10;

export interface CardsListCard extends CardsListItemCard {
addedAt: string;
Expand Down
4 changes: 2 additions & 2 deletions src/app/learning/learn-cards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class LearnCardsComponent {
return;
}

const cardsToLearn = this.learningService.selectCardsToLearn(cards, cardsToLearnAmount);
const cardsToLearn = this.learningService.selectCardsToLearn(cards, cardsToLearnCount);

this.cardsToLearnDialog.set({ open: true, cards: cardsToLearn });
}
Expand All @@ -63,4 +63,4 @@ export class LearnCardsComponent {
}
}

const cardsToLearnAmount = 15;
const cardsToLearnCount = 15;
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class LastCardsListComponent {
this.barnService
.cards()
?.toSorted((a, b) => b.addedAt.localeCompare(a.addedAt))
.slice(0, lastCardsAmount),
.slice(0, lastCardsCount),
);
cardDetailsDialog = signal<{ open: boolean; card: CardDetailsCard | null }>({ open: false, card: null });

Expand All @@ -46,4 +46,4 @@ export class LastCardsListComponent {
}
}

const lastCardsAmount = 10;
const lastCardsCount = 10;
8 changes: 4 additions & 4 deletions src/app/pages/home/unsorted-cards/unsorted-cards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { type CardDetailsCard } from '../../../cards/card-details/card-details.c
template: `
@if (someUnsortedCards().length > 0) {
<section>
<h2 class="text-lg text-secondary">Unsorted cards ({{ unsortedCardsAmount() }})</h2>
<h2 class="text-lg text-secondary">Unsorted cards ({{ unsortedCardsCount() }})</h2>
<ul class="columns-2 gap-4">
@for (card of someUnsortedCards(); track card.id) {
Expand Down Expand Up @@ -37,8 +37,8 @@ export class UnsortedCardsComponent {
private barnService = inject(BarnService);
private unsortedCards = computed(() => this.barnService.cards()?.filter(card => !card.definition));

unsortedCardsAmount = computed(() => this.unsortedCards()?.length ?? 0);
someUnsortedCards = computed(() => this.unsortedCards()?.slice(0, someUnsortedCardsAmount) ?? []);
unsortedCardsCount = computed(() => this.unsortedCards()?.length ?? 0);
someUnsortedCards = computed(() => this.unsortedCards()?.slice(0, someUnsortedCardsCount) ?? []);

cardDetailsDialog = signal<{ open: boolean; card: CardDetailsCard | null }>({ open: false, card: null });

Expand All @@ -47,4 +47,4 @@ export class UnsortedCardsComponent {
}
}

const someUnsortedCardsAmount = 10;
const someUnsortedCardsCount = 10;

0 comments on commit eabbb0e

Please sign in to comment.