Skip to content

Commit

Permalink
remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Apr 29, 2024
1 parent db1fb41 commit f1e01c1
Showing 2 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/app/card/card.page.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ export class CardPage implements OnInit {

public faq: Signal<ICardFAQEntry[]> = computed(() => {
const cardData = this.cardData();
if (!this.faqService.ready$() || !cardData) return [];
if (!cardData) return [];

return this.faqService.getCardFAQ(cardData.product, cardData.name);
});
20 changes: 1 addition & 19 deletions src/app/faq.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
inject,
Injectable,
Injector,
signal,
type WritableSignal,
} from '@angular/core';
import { inject, Injectable, signal, type WritableSignal } from '@angular/core';
import type { ICardFAQ, ICardFAQEntry } from '../../interfaces';
import { LocaleService } from './locale.service';
import { MetaService } from './meta.service';
@@ -15,10 +9,6 @@ import { MetaService } from './meta.service';
export class FAQService {
private metaService = inject(MetaService);
private localeService = inject(LocaleService);
private injector = inject(Injector);

private isReady = signal<boolean>(false);
public ready$ = this.isReady.asReadonly();

private allFAQs: WritableSignal<
Array<{
@@ -72,17 +62,13 @@ export class FAQService {
this.faqByProductLocaleCard.set(faqByProductLocaleCard);
})
);

if (!this.isReady()) this.isReady.set(true);
}

public getFAQs(): Array<{
productId: string;
locale: string;
faq: ICardFAQ[];
}> {
if (!this.isReady()) return [];

const faqData = this.faqByProductIdAndLocale();
const locale = this.localeService.currentLocale();

@@ -105,13 +91,9 @@ export class FAQService {
}

public getCardFAQ(productId: string, card: string): ICardFAQEntry[] {
if (!this.isReady()) return [];

const faq = this.faqByProductLocaleCard();
const locale = this.localeService.currentLocale();

console.log({ faq, locale }, 4);

return faq[productId]?.[locale]?.[card] ?? [];
}
}

0 comments on commit f1e01c1

Please sign in to comment.