Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(standalone/setup): dedicated setup page with React
Elian Doranc07ea1bfa7ba
diff --git a/apps/client/src/index.ts b/apps/client/src/index.tsindex dcc5feeb2a..5d750fc865 100644--- a/apps/client/src/index.ts+++ b/apps/client/src/index.ts@@ -112,6 +112,8 @@ function loadIcons() {}function setBodyAttributes() {+ if (!glob.isDbInitialized) return;+const { device, headingStyle, layoutOrientation, platform, isElectron, hasNativeTitleBar, hasBackgroundEffects, currentLocale } = window.glob;const classesToSet = [device,@@ -132,6 +134,11 @@ function setBodyAttributes() {}async function loadScripts() {+ if (!glob.dbInitialized) {+ await import("./setup.js");+ return;+ }+switch (glob.device) {case "mobile":await import("./mobile.js");diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsxnew file mode 100644index 0000000000..519da828f1--- /dev/null+++ b/apps/client/src/setup.tsx@@ -0,0 +1,13 @@+import { render } from "preact";++async function main() {+ const bodyWrapper = document.createElement("div");+ render(<App />, bodyWrapper);+ document.body.appendChild(bodyWrapper);+}++function App() {+ return <p>Loading...</p>;+}++main();diff --git a/apps/client/src/setup.ts b/apps/client/src/setup_old.tssimilarity index 100%rename from apps/client/src/setup.tsrename to apps/client/src/setup_old.tsdiff --git a/apps/client/src/types.d.ts b/apps/client/src/types.d.tsindex 545ff8e029..4a7401ab3a 100644--- a/apps/client/src/types.d.ts+++ b/apps/client/src/types.d.ts@@ -16,6 +16,7 @@ interface ElectronProcess {}interface CustomGlobals extends BootstrapDefinition {+ isDbInitialized: boolean;isDesktop: typeof utils.isDesktop;isMobile: typeof utils.isMobile;getComponentByEl: typeof appContext.getComponentByEl;