(pageId: string)
| 159 | } |
| 160 | |
| 161 | async setupPage(pageId: string) { |
| 162 | this.react.page?.deactivate(); |
| 163 | |
| 164 | let page; |
| 165 | |
| 166 | if (this.pageCache.has(pageId)) { |
| 167 | page = this.pageCache.get(pageId)!; |
| 168 | } else { |
| 169 | page = this.factories.Page({ app: this, id: pageId }); |
| 170 | |
| 171 | this.pageCache.add(page); |
| 172 | } |
| 173 | |
| 174 | this.react.page = page; |
| 175 | |
| 176 | pagesStore().loading = false; |
| 177 | |
| 178 | const parentPageId = this.parentPageId; |
| 179 | this.parentPageId = undefined; |
| 180 | |
| 181 | // Activate page |
| 182 | |
| 183 | page.activate(parentPageId); |
| 184 | |
| 185 | // Update current path |
| 186 | |
| 187 | await this.updateCurrentPath(pageId, parentPageId); |
| 188 | |
| 189 | await nextTick(); |
| 190 | |
| 191 | document |
| 192 | .querySelector(`.current-path[data-page-id="${pageId}"]`) |
| 193 | ?.scrollIntoView(); |
| 194 | } |
| 195 | |
| 196 | async updateCurrentPath(pageId: string, parentPageId?: string) { |
| 197 | if (this.react.pathPageIds.find((pathPageId) => pathPageId === pageId)) { |
nothing calls this directly
no test coverage detected