mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-23 07:19:50 -04:00
formatting and comments
This commit is contained in:
parent
8d1a21eceb
commit
b37eed2781
@ -13,12 +13,6 @@ export enum CardType {
|
||||
Error,
|
||||
}
|
||||
|
||||
export interface CardItem {
|
||||
readonly qry: string;
|
||||
readonly data: CardData;
|
||||
readonly type: CardType;
|
||||
}
|
||||
|
||||
export interface CardIcons {
|
||||
readonly words: string;
|
||||
readonly passage: string;
|
||||
@ -26,3 +20,12 @@ export interface CardIcons {
|
||||
readonly note: 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();
|
||||
|
||||
// subscribe to autocomplete input control's changes
|
||||
this.addSubscription(
|
||||
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.
|
||||
}
|
||||
|
||||
// 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) {
|
||||
if (this.savedPagedLoaded) {
|
||||
this.appService.getSavedPage(id);
|
||||
return;
|
||||
return; // you did it! stop trying.
|
||||
}
|
||||
// the saved page hasn't loaded yet, wait then try again.
|
||||
setTimeout(() => {
|
||||
this.onSavedPagedLoaded(id);
|
||||
}, 100);
|
||||
|
@ -240,6 +240,8 @@ export function reducer(state: AppState, action: AppAction): AppState {
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Cards
|
||||
|
||||
case 'ADD_CARD': {
|
||||
let cards = [];
|
||||
|
||||
@ -315,6 +317,9 @@ export function reducer(state: AppState, action: AppAction): AppState {
|
||||
cards,
|
||||
};
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
case 'SET_USER': {
|
||||
return {
|
||||
...state,
|
||||
|
Loading…
x
Reference in New Issue
Block a user