Skip to content

Commit

Permalink
Fixed navigation to plans from buy space button from ReachedPlanLimit…
Browse files Browse the repository at this point in the history
…Dialog
  • Loading branch information
Ramon Candel authored and Ramon Candel committed Jul 30, 2024
1 parent 66ded65 commit 3202944
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 => {
Expand All @@ -19,7 +21,12 @@ const ReachedPlanLimitDialog = (): JSX.Element => {
const onAccept = async (): Promise<void> => {
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);
}
Expand Down

0 comments on commit 3202944

Please sign in to comment.