1 import { useCallback } from 'react';
3 import { getAppHref } from '@proton/shared/lib/apps/helper';
4 import { APPS } from '@proton/shared/lib/constants';
5 import { isElectronApp } from '@proton/shared/lib/helpers/desktop';
7 import { openLinkInBrowser } from './openExternalLink';
8 import { useHasInboxDesktopInAppPayments } from './useHasInboxDesktopInAppPayments';
10 export function useRedirectToAccountApp() {
11 const hasInboxDesktopInAppPayments = useHasInboxDesktopInAppPayments();
13 return useCallback(() => {
14 if (isElectronApp && !hasInboxDesktopInAppPayments) {
15 openLinkInBrowser(getAppHref('/mail/dashboard', APPS.PROTONACCOUNT));
20 }, [hasInboxDesktopInAppPayments]);