perf: optimize Tasker boot and kanban load
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import { lazy, Suspense } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useCommandPalette } from "@/hooks/store/use-command-palette";
|
||||
|
||||
const ProfileSettingsModal = lazy(() =>
|
||||
import("@/components/settings/profile/modal").then((module) => ({
|
||||
@@ -24,6 +25,10 @@ type TGlobalModalsProps = {
|
||||
* - Profile settings modal
|
||||
*/
|
||||
export const GlobalModals = observer(function GlobalModals(_props: TGlobalModalsProps) {
|
||||
const { profileSettingsModal } = useCommandPalette();
|
||||
|
||||
if (!profileSettingsModal.isOpen) return null;
|
||||
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
<ProfileSettingsModal />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams, usePathname } from "next/navigation";
|
||||
import { cn } from "@plane/utils";
|
||||
import { TopNavPowerK } from "@/components/navigation";
|
||||
import { DeferredTopNavPowerK } from "@/components/navigation/deferred-top-nav-power-k";
|
||||
import { UserMenuRoot } from "@/components/workspace/sidebar/user-menu-root";
|
||||
import { WorkspaceMenuRoot } from "@/components/workspace/sidebar/workspace-menu-root";
|
||||
import { useAppRailPreferences } from "@/hooks/use-navigation-preferences";
|
||||
@@ -57,7 +57,7 @@ export const TopNavigationRoot = observer(function TopNavigationRoot() {
|
||||
</div>
|
||||
{/* Power K Search */}
|
||||
<div className="shrink-0">
|
||||
<TopNavPowerK />
|
||||
<DeferredTopNavPowerK />
|
||||
</div>
|
||||
{/* Additional Actions */}
|
||||
<div className="flex flex-1 shrink-0 items-center justify-end gap-1">
|
||||
|
||||
@@ -7,14 +7,21 @@
|
||||
// store
|
||||
import { CoreRootStore } from "@/store/root.store";
|
||||
import type { ITimelineStore } from "./timeline";
|
||||
import { TimeLineStore } from "./timeline";
|
||||
|
||||
export class RootStore extends CoreRootStore {
|
||||
timelineStore: ITimelineStore;
|
||||
timelineStore: ITimelineStore | undefined;
|
||||
private timelineStorePromise: Promise<ITimelineStore> | undefined;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
loadTimelineStore = async (): Promise<ITimelineStore> => {
|
||||
if (this.timelineStore) return this.timelineStore;
|
||||
|
||||
this.timelineStore = new TimeLineStore(this);
|
||||
if (!this.timelineStorePromise) {
|
||||
this.timelineStorePromise = import("./timeline").then(({ TimeLineStore }) => {
|
||||
this.timelineStore = new TimeLineStore(this);
|
||||
return this.timelineStore;
|
||||
});
|
||||
}
|
||||
|
||||
return this.timelineStorePromise;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user