MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / finishSetup

Method finishSetup

apps/client/src/code/pages/page/page.ts:281–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279 }
280
281 async finishSetup() {
282 try {
283 this.react.loading = true;
284
285 // Setup collaboration
286
287 await this.collab.setup();
288
289 // Post-sync setup
290
291 this.elems.setup();
292
293 this.undoRedo.setup();
294
295 this.react.status = 'success';
296
297 await sleep();
298 await watchUntilTrue(() => {
299 for (const note of this.react.notes) {
300 if (!note.react.loaded) {
301 return false;
302 }
303 }
304
305 return true;
306 });
307 await sleep();
308
309 mainLogger.sub('page.finishSetup').info('All notes loaded');
310
311 const elemId =
312 ((route().value.query.note ?? route().value.query.elem) as string) ??
313 '';
314
315 if (isNanoID(elemId)) {
316 const elem = this.notes.fromId(elemId) ?? this.arrows.fromId(elemId);
317
318 if (elem != null) {
319 this.selection.set(elem);
320
321 const elemElem =
322 elem.type === 'note'
323 ? elem.getElem('note-frame')
324 : elem.getHitboxElem();
325
326 if (elemElem != null) {
327 scrollIntoView(elemElem, {
328 animate: false,
329 centerCamera: true,
330 });
331 }
332 }
333 }
334
335 this.camera.fitToScreen();
336
337 await sleep();
338 } catch (error) {

Callers

nothing calls this directly

Calls 12

sleepFunction · 0.90
watchUntilTrueFunction · 0.90
isNanoIDFunction · 0.90
scrollIntoViewFunction · 0.90
routeFunction · 0.85
subMethod · 0.80
getElemMethod · 0.80
getHitboxElemMethod · 0.80
fitToScreenMethod · 0.80
setMethod · 0.65
setupMethod · 0.45
fromIdMethod · 0.45

Tested by

no test coverage detected