tweak performance

hook up verse picker
This commit is contained in:
Jason Wall 2020-07-21 19:12:57 -04:00
parent ee28beb886
commit 216cf880e5
5 changed files with 18 additions and 15 deletions

View File

@ -7,3 +7,7 @@
color: var(--primary-color);
}
}
mat-sidenav-content {
overflow: hidden;
}

View File

@ -43,6 +43,9 @@ mat-card {
}
.search-content {
height: calc(100vh - 5.5rem);
padding: 0 1rem 0 1rem;
overflow-y: scroll;
height: calc(100vh - 66px);
width: calc(100% - 15px);
margin-top: 2px;
}

View File

@ -2,7 +2,7 @@ import { Component, OnInit, HostListener } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { FormControl } from '@angular/forms';
import { map, startWith } from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { AppService } from 'src/app/services/app.service';
import { NavService } from 'src/app/services/nav.service';
import { OpenData, CardItem } from 'src/app/models/app-state';
@ -36,13 +36,8 @@ export class SearchPage implements OnInit {
}
this.suggestions$ = this.searchControl.valueChanges.pipe(
startWith(''),
map((value) => this.getSearchItems(value))
);
// this.appService.state$.subscribe((state) => {
// console.log(state);
// });
}
launchPicker() {

View File

@ -33,6 +33,9 @@ export class VersePickerModalComponent {
setChapter(chapter: number) {
// close the control, trigger the passage event.
this.appService.getNewPassage(
new BibleReference(this.book.name + ' ' + chapter)
);
this.dialogRef.close();
}
}

View File

@ -98,14 +98,12 @@ function reducer(state: AppState, action: AppAction): AppState {
case 'UPDATE_CARD': {
return {
...state,
cards: [
...state.cards.map((c) => {
if (c === action.oldCard) {
return action.newCard;
}
return c;
}),
],
cards: state.cards.map((c) => {
if (c === action.oldCard) {
return action.newCard;
}
return c;
}),
};
}
case 'REMOVE_CARD': {