1 import { useEffect, useState } from 'react';
3 import { WorkerMessageType } from '@proton/pass/types';
4 import { sendExtensionMessage } from '@proton/shared/lib/browser/extension';
5 import { APPS } from '@proton/shared/lib/constants';
6 import noop from '@proton/utils/noop';
8 export const usePassExtensionInstalled = (supported: boolean): boolean => {
9 const [installed, setInstalled] = useState(true);
14 { type: WorkerMessageType.ACCOUNT_PROBE },
15 { app: APPS.PROTONPASSBROWSEREXTENSION, maxTimeout: 1_000 }
17 .then((result) => setInstalled(result?.type === 'success'))