Skip to content

Commit

Permalink
Remove appId from chrome state.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Dec 7, 2023
1 parent d8e21e7 commit cc9133a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/ChromeLink/ChromeLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { appNavClick } from '../../redux/actions';
import NavContext, { OnLinkClick } from '../Navigation/navContext';
import { ReduxState } from '../../redux/store';
import { NavDOMEvent, RouteDefinition } from '../../@types/types';
import { useAtomValue } from 'jotai';
import { activeModuleAtom } from '../../state/atoms';

interface RefreshLinkProps extends React.HTMLAttributes<HTMLAnchorElement> {
isExternal?: boolean;
Expand Down Expand Up @@ -137,7 +139,7 @@ const RefreshLink: React.FC<RefreshLinkProps> = (props) => {

const ChromeLink: React.FC<LinkWrapperProps> = ({ appId, children, ...rest }) => {
const { onLinkClick, isNavOpen, inPageLayout } = useContext(NavContext);
const currAppId = useSelector(({ chrome }: ReduxState) => chrome?.appId);
const currAppId = useAtomValue(activeModuleAtom);

const LinkComponent = !rest.isExternal ? LinkWrapper : RefreshLink;
return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/GlobalFilter/GlobalFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { activeModuleAtom } from '../../state/atoms';
const useLoadTags = (hasAccess = false) => {
const navigate = useNavigate();
const registeredWith = useSelector(({ globalFilter: { scope } }: ReduxState) => scope);
const isDisabled = useSelector(({ globalFilter: { globalFilterHidden }, chrome: { appId } }: ReduxState) => globalFilterHidden || !appId);
const activeModule = useAtomValue(activeModuleAtom);
const isDisabled = useSelector(({ globalFilter: { globalFilterHidden } }: ReduxState) => globalFilterHidden || !activeModule);
const dispatch = useDispatch();
return useCallback(
debounce((activeTags: any, search: any) => {
Expand Down
5 changes: 0 additions & 5 deletions src/redux/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ export type ChromeState = {
contextSwitcherOpen: boolean;
activeApp?: string;
activeProduct?: string;
/**
* @deprecated
* App id is replaced by active module. It is still required until we completely remove usage of main.yml
*/
appId?: string;
missingIDP?: boolean;
pageAction?: string;
pageObjectId?: string;
Expand Down

0 comments on commit cc9133a

Please sign in to comment.