oops... you mostly don't use the note: syntax, so you need to pass the type for notes so you know what it is.

This commit is contained in:
Jason Wall 2020-11-26 11:06:47 -05:00
parent 62a82142fa
commit 78a349fb0f
2 changed files with 7 additions and 4 deletions

View File

@ -19,3 +19,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
- Android and IOS mobile apps with Ionic Capactor
- setup CI/CD
- strongs numbers with more than one number should appear in tabs or you need to update your text to assign only one number per word(s)
- strongs references need a scrolling box to prevent massive cards
- fix the toString error
- fix headings/formatting of notes

View File

@ -157,7 +157,7 @@ export class AppService extends createStateService(reducer, initialState) {
async updateCards(queries: IStorable<readonly DataReference[]>) {
const cards: CardItem[] = [];
for (const q of queries.value) {
const card = await this.getCardByQuery(q.qry);
const card = await this.getCardByQuery(q.qry, q.type);
cards.push(card);
}
this.dispatch(
@ -169,8 +169,8 @@ export class AppService extends createStateService(reducer, initialState) {
);
}
private async getCardByQuery(qry: string): Promise<CardItem> {
if (qry.startsWith('note:')) {
private async getCardByQuery(qry: string, type?: CardType): Promise<CardItem> {
if (qry.startsWith('note:') || (type !== undefined && type === CardType.Note)) {
const id = qry.replace('note:', '');
const data = this.getState().notes.value.find((o) => o.id === id);
if (!data) {
@ -223,7 +223,7 @@ export class AppService extends createStateService(reducer, initialState) {
const cards = [];
for (const ref of page.queries) {
cards.push(await this.getCardByQuery(ref.qry));
cards.push(await this.getCardByQuery(ref.qry, ref.type));
}
this.dispatch(AppActionFactory.newUpdateCards(new Storable(cards)));