Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: minor refactors

Abdullah Attac5dfc0208572
diff --git a/apps/web/src/root.tsx b/apps/web/src/root.tsx
index 361881948..8af0c64f1 100644
--- a/apps/web/src/root.tsx
+++ b/apps/web/src/root.tsx
@@ -94,16 +94,13 @@ function RouteWrapper(props: {
}) {
const { component, path, routeProps } = props;
const result = usePromise(async () => {
- await import("./hooks/use-database").then(({ loadDatabase }) =>
- loadDatabase(
- path !== "/sessionexpired" || Config.get("sessionExpired", false)
- ? "db"
- : "memory"
- )
+ const { loadDatabase } = await import("./hooks/use-database");
+ await loadDatabase(
+ path !== "/sessionexpired" || Config.get("sessionExpired", false)
+ ? "db"
+ : "memory"
);
-
- const { default: Component } = await component();
- return Component;
+ return (await component()).default;
}, [component, path]);
if (result.status === "rejected") {