Fix table focus taking over auth and filter and sort (#478)
This commit is contained in:
@ -12,6 +12,7 @@ import { Modal } from '@/auth/components/ui/Modal';
|
||||
import { Title } from '@/auth/components/ui/Title';
|
||||
import { authFlowUserEmailState } from '@/auth/states/authFlowUserEmailState';
|
||||
import { isMockModeState } from '@/auth/states/isMockModeState';
|
||||
import { captureHotkeyTypeInFocusState } from '@/hotkeys/states/captureHotkeyTypeInFocusState';
|
||||
import { PrimaryButton } from '@/ui/components/buttons/PrimaryButton';
|
||||
import { SecondaryButton } from '@/ui/components/buttons/SecondaryButton';
|
||||
import { TextInput } from '@/ui/components/inputs/TextInput';
|
||||
@ -25,6 +26,9 @@ const StyledContentContainer = styled.div`
|
||||
`;
|
||||
|
||||
export function Index() {
|
||||
const [, setCaptureHotkeyTypeInFocus] = useRecoilState(
|
||||
captureHotkeyTypeInFocusState,
|
||||
);
|
||||
const navigate = useNavigate();
|
||||
const theme = useTheme();
|
||||
const [, setMockMode] = useRecoilState(isMockModeState);
|
||||
@ -55,7 +59,8 @@ export function Index() {
|
||||
|
||||
useEffect(() => {
|
||||
setMockMode(true);
|
||||
}, [navigate, setMockMode]);
|
||||
setCaptureHotkeyTypeInFocus(true);
|
||||
}, [navigate, setMockMode, setCaptureHotkeyTypeInFocus]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -12,6 +12,7 @@ import { Title } from '@/auth/components/ui/Title';
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { authFlowUserEmailState } from '@/auth/states/authFlowUserEmailState';
|
||||
import { isMockModeState } from '@/auth/states/isMockModeState';
|
||||
import { captureHotkeyTypeInFocusState } from '@/hotkeys/states/captureHotkeyTypeInFocusState';
|
||||
import { PrimaryButton } from '@/ui/components/buttons/PrimaryButton';
|
||||
import { TextInput } from '@/ui/components/inputs/TextInput';
|
||||
import { Companies } from '~/pages/companies/Companies';
|
||||
@ -37,6 +38,9 @@ const StyledErrorContainer = styled.div`
|
||||
export function PasswordLogin() {
|
||||
const navigate = useNavigate();
|
||||
const [, setMockMode] = useRecoilState(isMockModeState);
|
||||
const [, setCaptureHotkeyTypeInFocus] = useRecoilState(
|
||||
captureHotkeyTypeInFocusState,
|
||||
);
|
||||
|
||||
const prefillPassword =
|
||||
process.env.NODE_ENV === 'development' ? 'applecar2025' : '';
|
||||
@ -53,11 +57,19 @@ export function PasswordLogin() {
|
||||
try {
|
||||
await login(authFlowUserEmail, internalPassword);
|
||||
setMockMode(false);
|
||||
setCaptureHotkeyTypeInFocus(false);
|
||||
navigate('/');
|
||||
} catch (err: any) {
|
||||
setFormError(err.message);
|
||||
}
|
||||
}, [authFlowUserEmail, internalPassword, login, navigate, setMockMode]);
|
||||
}, [
|
||||
authFlowUserEmail,
|
||||
internalPassword,
|
||||
login,
|
||||
navigate,
|
||||
setMockMode,
|
||||
setCaptureHotkeyTypeInFocus,
|
||||
]);
|
||||
|
||||
useHotkeys(
|
||||
'enter',
|
||||
|
||||
Reference in New Issue
Block a user