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

This commit is contained in:
Prateek Shourya 2025-11-27 20:53:42 +05:30 committed by GitHub
parent 39749106a2
commit 3c84e75350
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -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;

View file

@ -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": {