Skip to content

Commit

Permalink
web: minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Aug 21, 2024
1 parent bb9a643 commit c5dfc02
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions apps/web/src/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit c5dfc02

Please sign in to comment.