You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
854 B
TypeScript

// Copyright (C) 2022 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import Spin from 'antd/lib/spin';
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router';
import { saveLogsAsync } from 'actions/annotation-actions';
import { logoutAsync } from 'actions/auth-actions';
function LogoutComponent(): JSX.Element {
const dispatch = useDispatch();
const history = useHistory();
useEffect(() => {
dispatch(saveLogsAsync()).then(() => {
dispatch(logoutAsync()).then(() => {
history.goBack();
});
});
}, []);
return (
<div className='cvat-logout-page cvat-spinner-container'>
<Spin className='cvat-spinner' />
</div>
);
}
export default React.memo(LogoutComponent);