Reveiw
This commit is contained in:
parent
ad7968dadd
commit
5bf8e752e7
22 changed files with 81 additions and 112 deletions
|
|
@ -38,9 +38,10 @@ export class PagesComponent implements OnDestroy {
|
|||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
if (!this.store.loading() && this.store.pages().length === 0) {
|
||||
const pages = this.store.pages();
|
||||
if (!this.store.loading() && pages.length === 0) {
|
||||
this.showWelcome.set(true);
|
||||
} else if (this.store.pages().length > 0) {
|
||||
} else if (pages.length > 0) {
|
||||
this.showWelcome.set(false);
|
||||
}
|
||||
});
|
||||
|
|
@ -89,9 +90,10 @@ export class PagesComponent implements OnDestroy {
|
|||
});
|
||||
|
||||
readonly selectedPageIndex = computed(() => {
|
||||
const pages = this.store.pages();
|
||||
const page = this.selectedPage();
|
||||
if (!page) return -1;
|
||||
return this.store.pages().findIndex((p) => p.id === page.id);
|
||||
return pages.findIndex((p) => p.id === page.id);
|
||||
});
|
||||
|
||||
onSelectPage(index: number): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue