Skip to content

Commit 3c84e75

Browse files
[WEB-5510] fix: handle null values in context indicator for improved stability (#8190)
1 parent 3974910 commit 3c84e75

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// local imports
2-
import type { TPowerKContextTypeExtended } from "../types";
2+
import type { TPowerKContextType } from "@/components/power-k/core/types";
33

44
type TArgs = {
5-
activeContext: TPowerKContextTypeExtended | null;
5+
activeContext: TPowerKContextType | null;
66
};
77

88
export const useExtendedContextIndicator = (_args: TArgs): string | null => null;

apps/web/core/components/power-k/hooks/use-context-indicator.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { useCycle } from "@/hooks/store/use-cycle";
66
import { useModule } from "@/hooks/store/use-module";
77
// plane web imports
88
import { useExtendedContextIndicator } from "@/plane-web/components/command-palette/power-k/hooks/use-extended-context-indicator";
9-
import type { TPowerKContextTypeExtended } from "@/plane-web/components/command-palette/power-k/types";
109
import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store";
1110
// local imports
1211
import type { TPowerKContextType } from "../core/types";
@@ -25,13 +24,13 @@ export const useContextIndicator = (args: TArgs): string | null => {
2524
const { getPageById } = usePageStore(EPageStoreType.PROJECT);
2625
// extended context indicator
2726
const extendedIndicator = useExtendedContextIndicator({
28-
activeContext: activeContext as TPowerKContextTypeExtended,
27+
activeContext,
2928
});
3029
let indicator: string | undefined | null = null;
3130

3231
switch (activeContext) {
3332
case "work-item": {
34-
indicator = workItemIdentifier.toString();
33+
indicator = workItemIdentifier ? workItemIdentifier.toString() : null;
3534
break;
3635
}
3736
case "cycle": {

0 commit comments

Comments
 (0)