Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-5510] fix: handle null values in context indicator for improved stability (#8190)

Prateek Shourya3c84e7535021
diff --git a/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts b/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts
index ad5f43860b..e92e54e2e6 100644
--- a/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts
+++ b/apps/web/ce/components/command-palette/power-k/hooks/use-extended-context-indicator.ts
@@ -1,8 +1,8 @@
// local imports
-import type { TPowerKContextTypeExtended } from "../types";
+import type { TPowerKContextType } from "@/components/power-k/core/types";
type TArgs = {
- activeContext: TPowerKContextTypeExtended | null;
+ activeContext: TPowerKContextType | null;
};
export const useExtendedContextIndicator = (_args: TArgs): string | null => null;
diff --git a/apps/web/core/components/power-k/hooks/use-context-indicator.ts b/apps/web/core/components/power-k/hooks/use-context-indicator.ts
index d598181bc4..52699135a5 100644
--- a/apps/web/core/components/power-k/hooks/use-context-indicator.ts
+++ b/apps/web/core/components/power-k/hooks/use-context-indicator.ts
@@ -6,7 +6,6 @@ import { useCycle } from "@/hooks/store/use-cycle";
import { useModule } from "@/hooks/store/use-module";
// plane web imports
import { useExtendedContextIndicator } from "@/plane-web/components/command-palette/power-k/hooks/use-extended-context-indicator";
-import type { TPowerKContextTypeExtended } from "@/plane-web/components/command-palette/power-k/types";
import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store";
// local imports
import type { TPowerKContextType } from "../core/types";
@@ -25,13 +24,13 @@ export const useContextIndicator = (args: TArgs): string | null => {
const { getPageById } = usePageStore(EPageStoreType.PROJECT);
// extended context indicator
const extendedIndicator = useExtendedContextIndicator({
- activeContext: activeContext as TPowerKContextTypeExtended,
+ activeContext,
});
let indicator: string | undefined | null = null;
switch (activeContext) {
case "work-item": {
- indicator = workItemIdentifier.toString();
+ indicator = workItemIdentifier ? workItemIdentifier.toString() : null;
break;
}
case "cycle": {