Skip to content

Commit

Permalink
minor improvements to refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
outspokeio committed Nov 11, 2023
1 parent a2bf92a commit 735e8cb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/renderer/Commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const Commands = () => {
))}
</div>
<div className='flex flex-row justify-around w-full py-4 text-xs text-gray-600'>
<div>
<div onClick={() => fetchCommands()} className='cursor-pointer'>
<span className='mr-2 text-gray-300'>
{window.navigator.userAgent.includes('Mac') ? '⌘+r' : 'ctrl+r'}
</span>
Expand Down
32 changes: 16 additions & 16 deletions src/renderer/Inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ const Inputs = () => {
)
}, [location]);

const handleKeyPress = useCallback((event: any) => {
if(event.altKey && event.key === 'ArrowLeft') {
console.log('backspace');
navigate(-1);
}
}, []);

useEffect(() => {
// attach the event listener
document.addEventListener('keydown', handleKeyPress);

// remove the event listener
return () => {
document.removeEventListener('keydown', handleKeyPress);
};
}, [handleKeyPress]);
// const handleKeyPress = useCallback((event: any) => {
// if(event.altKey && event.key === 'ArrowLeft') {
// console.log('backspace');
// navigate(-1);
// }
// }, []);

// useEffect(() => {
// // attach the event listener
// document.addEventListener('keydown', handleKeyPress);

// // remove the event listener
// return () => {
// document.removeEventListener('keydown', handleKeyPress);
// };
// }, [handleKeyPress]);

const updateInput = (e: any, id: any) => {
const newInputs : any = inputs.map((input: any) => {
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { Auth, API } from 'aws-amplify';
import { useNavigate } from 'react-router-dom';
import logo from '../../assets/images/IndigoLogoHorizontal2.png';
import './App.css'
import { useAppStore } from '../../lib/store';

const Login = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [loginIncorrect, setLoginIncorrect] = useState(false);
const navigate = useNavigate();
const { fetchCommands } = useAppStore()

useEffect(() => {
window.electron.ipcRenderer.send(
Expand All @@ -27,6 +29,7 @@ const Login = () => {
try {
await Auth.signIn(email, password).then((user: any) => {
console.log('user: ', user);
fetchCommands();
navigate('/');
setIsLoading(false);
return user;
Expand Down

0 comments on commit 735e8cb

Please sign in to comment.