File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
web/core/components/command-palette Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export const CommandPaletteSearchResults: React.FC<Props> = (props) => {
2828 const section = ( results . results as any ) [ key ] ;
2929 const currentSection = commandGroups [ key ] ;
3030
31+ if ( ! currentSection ) return null ;
3132 if ( section . length > 0 ) {
3233 return (
3334 < Command . Group key = { key } heading = { `${ currentSection . title } search` } >
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ const workspaceService = new WorkspaceService();
5151export const CommandModal : React . FC = observer ( ( ) => {
5252 // router
5353 const router = useAppRouter ( ) ;
54- const { workspaceSlug, workItem } = useParams ( ) ;
54+ const { workspaceSlug, projectId : routerProjectId , workItem } = useParams ( ) ;
5555 // states
5656 const [ placeholder , setPlaceholder ] = useState ( "Type a command or search..." ) ;
5757 const [ resultsCount , setResultsCount ] = useState ( 0 ) ;
@@ -91,7 +91,7 @@ export const CommandModal: React.FC = observer(() => {
9191 // derived values
9292 const issueDetails = workItemDetailsSWR ? getIssueById ( workItemDetailsSWR ?. id ) : null ;
9393 const issueId = issueDetails ?. id ;
94- const projectId = issueDetails ?. project_id ;
94+ const projectId = issueDetails ?. project_id ?? routerProjectId ;
9595 const page = pages [ pages . length - 1 ] ;
9696 const debouncedSearchTerm = useDebounce ( searchTerm , 500 ) ;
9797 const { baseTabIndex } = getTabIndex ( undefined , isMobile ) ;
@@ -477,6 +477,7 @@ export const CommandModal: React.FC = observer(() => {
477477 < ToggleSwitch
478478 value = { isWorkspaceLevel }
479479 onChange = { ( ) => setIsWorkspaceLevel ( ( prevData ) => ! prevData ) }
480+ disabled = { ! projectId }
480481 size = "sm"
481482 />
482483 </ div >
You can’t perform that action at this time.
0 commit comments