fix: auto-load first library section on open
PrayerView's select displayed the first option natively while activeSection stayed null, so content only appeared after manually changing selection. Initialize to first section and load it on render for all 8 collections.
This commit is contained in:
1 parent
f49735b360
commit
9cef9130cc
1 file changed
+5
@@ -191,6 +191,9 @@ export class PrayerView {
|
|||||||
|
|
||||||
async render() {
|
async render() {
|
||||||
const sections = this.getSections();
|
const sections = this.getSections();
|
||||||
|
if (!this.activeSection) {
|
||||||
|
this.activeSection = sections[0]?.id ?? null;
|
||||||
|
}
|
||||||
const isTriodion = this.collection === 'triodion';
|
const isTriodion = this.collection === 'triodion';
|
||||||
const subtitle = isTriodion ? this.t.triodion.subtitle
|
const subtitle = isTriodion ? this.t.triodion.subtitle
|
||||||
: this.collection === 'akathists' ? this.t.akathists.subtitle
|
: this.collection === 'akathists' ? this.t.akathists.subtitle
|
||||||
@@ -250,6 +253,8 @@ export class PrayerView {
|
|||||||
this.activeSection = id;
|
this.activeSection = id;
|
||||||
this.loadSection(id);
|
this.loadSection(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.activeSection) void this.loadSection(this.activeSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async loadSection(id: string) {
|
private async loadSection(id: string) {
|
||||||
|
|||||||
Reference in new issue
Block a user