MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / setupPage

Method setupPage

apps/client/src/code/pages/pages.ts:161–194  ·  view source on GitHub ↗
(pageId: string)

Source from the content-addressed store, hash-verified

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)) {

Callers

nothing calls this directly

Calls 7

updateCurrentPathMethod · 0.95
deactivateMethod · 0.80
activateMethod · 0.80
scrollIntoViewMethod · 0.80
getMethod · 0.65
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected