diff --git a/src/app/drive/components/ReachedPlanLimitDialog/ReachedPlanLimitDialog.tsx b/src/app/drive/components/ReachedPlanLimitDialog/ReachedPlanLimitDialog.tsx index 40fc211bb..04af9a5e1 100644 --- a/src/app/drive/components/ReachedPlanLimitDialog/ReachedPlanLimitDialog.tsx +++ b/src/app/drive/components/ReachedPlanLimitDialog/ReachedPlanLimitDialog.tsx @@ -1,15 +1,17 @@ import navigationService from 'app/core/services/navigation.service'; -import { AppView } from 'app/core/types'; import { useTranslationContext } from 'app/i18n/provider/TranslationProvider'; import BaseDialog from 'app/shared/components/BaseDialog/BaseDialog'; import Button from 'app/shared/components/Button/Button'; import { useAppDispatch, useAppSelector } from 'app/store/hooks'; import { uiActions } from 'app/store/slices/ui'; import DriveStorageError from '../../../../assets/images/drive-error.svg'; +import workspacesSelectors from '../../../store/slices/workspaces/workspaces.selectors'; const ReachedPlanLimitDialog = (): JSX.Element => { const { translate } = useTranslationContext(); const isOpen = useAppSelector((state) => state.ui.isReachedPlanLimitDialogOpen); + const selectedWorkspace = useAppSelector(workspacesSelectors.getSelectedWorkspace); + const dispatch = useAppDispatch(); const onClose = (): void => { @@ -19,7 +21,12 @@ const ReachedPlanLimitDialog = (): JSX.Element => { const onAccept = async (): Promise => { try { dispatch(uiActions.setIsReachedPlanLimitDialogOpen(false)); - navigationService.push(AppView.Preferences, { tab: 'plans' }); + navigationService.openPreferencesDialog({ + section: 'account', + subsection: 'plans', + workspaceUuid: selectedWorkspace?.workspaceUser.workspaceId, + }); + dispatch(uiActions.setIsPreferencesDialogOpen(true)); } catch (e: unknown) { console.log(e); }