deps(node): typescript 3.9.6 => 4.1.3

This commit is contained in:
Matthew Penner 2021-02-05 09:42:57 -07:00
parent 9184cbdf11
commit 72be2808f3
7 changed files with 2582 additions and 2483 deletions

View file

@ -1,13 +1,13 @@
import * as React from 'react';
import React from 'react';
import ContentBox from '@/components/elements/ContentBox';
import UpdatePasswordForm from '@/components/dashboard/forms/UpdatePasswordForm';
import UpdateEmailAddressForm from '@/components/dashboard/forms/UpdateEmailAddressForm';
import ConfigureTwoFactorForm from '@/components/dashboard/forms/ConfigureTwoFactorForm';
import PageContentBlock from '@/components/elements/PageContentBlock';
import { useLocation } from 'react-router-dom';
import tw from 'twin.macro';
import { breakpoint } from '@/theme';
import styled from 'styled-components/macro';
import { RouteComponentProps } from 'react-router';
import MessageBox from '@/components/MessageBox';
const Container = styled.div`
@ -26,7 +26,9 @@ const Container = styled.div`
}
`;
export default ({ location: { state } }: RouteComponentProps) => {
export default () => {
const state = useLocation<{ twoFactorRedirect: boolean }>().state;
return (
<PageContentBlock title={'Account Overview'}>
{state?.twoFactorRedirect &&

View file

@ -20,6 +20,18 @@ export default () => {
const setServerStatus = ServerContext.useStoreActions(actions => actions.status.setServerStatus);
const { setInstance, setConnectionState } = ServerContext.useStoreActions(actions => actions.socket);
const updateToken = (uuid: string, socket: Websocket) => {
if (updatingToken) return;
updatingToken = true;
getWebsocketToken(uuid)
.then(data => socket.setToken(data.token, true))
.catch(error => console.error(error))
.then(() => {
updatingToken = false;
});
};
const connect = (uuid: string) => {
const socket = new Websocket();
@ -73,18 +85,6 @@ export default () => {
.catch(error => console.error(error));
};
const updateToken = (uuid: string, socket: Websocket) => {
if (updatingToken) return;
updatingToken = true;
getWebsocketToken(uuid)
.then(data => socket.setToken(data.token, true))
.catch(error => console.error(error))
.then(() => {
updatingToken = false;
});
};
useEffect(() => {
connected && setError('');
}, [ connected ]);

View file

@ -24,7 +24,7 @@ const LazyCodemirrorEditor = lazy(() => import(/* webpackChunkName: "editor" */'
export default () => {
const [ error, setError ] = useState('');
const { action } = useParams();
const { action } = useParams<{ action: string }>();
const [ loading, setLoading ] = useState(action === 'edit');
const [ content, setContent ] = useState('');
const [ modalVisible, setModalVisible ] = useState(false);

View file

@ -48,7 +48,7 @@ const ActivePill = ({ active }: { active: boolean }) => (
export default () => {
const params = useParams() as Params;
const history = useHistory();
const state: State = useLocation().state;
const state = useLocation<State>().state;
const id = ServerContext.useStoreState(state => state.server.data!.id);
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);