mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-23 15:30:14 -04:00
formatting and comments
This commit is contained in:
parent
8d1a21eceb
commit
b37eed2781
@ -13,12 +13,6 @@ export enum CardType {
|
|||||||
Error,
|
Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CardItem {
|
|
||||||
readonly qry: string;
|
|
||||||
readonly data: CardData;
|
|
||||||
readonly type: CardType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CardIcons {
|
export interface CardIcons {
|
||||||
readonly words: string;
|
readonly words: string;
|
||||||
readonly passage: string;
|
readonly passage: string;
|
||||||
@ -26,3 +20,12 @@ export interface CardIcons {
|
|||||||
readonly note: string;
|
readonly note: string;
|
||||||
readonly savedPage: string;
|
readonly savedPage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DataReference {
|
||||||
|
readonly qry: string;
|
||||||
|
readonly type: CardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CardItem extends DataReference {
|
||||||
|
readonly data: CardData;
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ export class SearchPage extends SubscriberBase implements OnInit {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
|
|
||||||
// subscribe to autocomplete input control's changes
|
// subscribe to autocomplete input control's changes
|
||||||
this.addSubscription(
|
this.addSubscription(
|
||||||
this.searchControl.valueChanges.subscribe((value: string) => this.appService.getAutoComplete(value.toLowerCase()))
|
this.searchControl.valueChanges.subscribe((value: string) => this.appService.getAutoComplete(value.toLowerCase()))
|
||||||
@ -77,12 +78,14 @@ export class SearchPage extends SubscriberBase implements OnInit {
|
|||||||
this.navService.closeNav(); // close the nav immediately.
|
this.navService.closeNav(); // close the nav immediately.
|
||||||
}
|
}
|
||||||
|
|
||||||
// monitor the saved paged loaded property, and fire the action once it turns true, then stop.
|
// monitor the saved paged loaded property,
|
||||||
|
// and fire the action once it turns true, then stop.
|
||||||
onSavedPagedLoaded(id: string) {
|
onSavedPagedLoaded(id: string) {
|
||||||
if (this.savedPagedLoaded) {
|
if (this.savedPagedLoaded) {
|
||||||
this.appService.getSavedPage(id);
|
this.appService.getSavedPage(id);
|
||||||
return;
|
return; // you did it! stop trying.
|
||||||
}
|
}
|
||||||
|
// the saved page hasn't loaded yet, wait then try again.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.onSavedPagedLoaded(id);
|
this.onSavedPagedLoaded(id);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
@ -240,6 +240,8 @@ export function reducer(state: AppState, action: AppAction): AppState {
|
|||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region Cards
|
||||||
|
|
||||||
case 'ADD_CARD': {
|
case 'ADD_CARD': {
|
||||||
let cards = [];
|
let cards = [];
|
||||||
|
|
||||||
@ -315,6 +317,9 @@ export function reducer(state: AppState, action: AppAction): AppState {
|
|||||||
cards,
|
cards,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|
||||||
case 'SET_USER': {
|
case 'SET_USER': {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user