Ensure Policy Modal opens upon login

This commit is contained in:
Chewbacca 2022-11-04 07:36:48 -04:00
parent 53208bd670
commit 472df260fe

View file

@ -504,10 +504,12 @@ const UI: React.FC = ({ children }) => {
}, [vapidKey]); }, [vapidKey]);
useEffect(() => { useEffect(() => {
if (pendingPolicy && supportedPolicyIds.includes(pendingPolicy.pending_policy_id)) { if (account && pendingPolicy && supportedPolicyIds.includes(pendingPolicy.pending_policy_id)) {
dispatch(openModal('POLICY')); setTimeout(() => {
dispatch(openModal('POLICY'));
}, 500);
} }
}, [pendingPolicy]); }, [pendingPolicy, !!account]);
const handleHotkeyNew = (e?: KeyboardEvent) => { const handleHotkeyNew = (e?: KeyboardEvent) => {
e?.preventDefault(); e?.preventDefault();