|
|
|
@ -23,6 +23,7 @@ import AppLogo from '@/assets/highlights_travel_300_300.png'
|
|
|
|
|
import '@/assets/App.css'
|
|
|
|
|
import 'react-chat-elements/dist/main.css'
|
|
|
|
|
import EmailFetch from './Conversations/Online/Components/EmailFetch'
|
|
|
|
|
import { getEmailFetchAction } from '@/actions/EmailActions'
|
|
|
|
|
|
|
|
|
|
function AuthApp() {
|
|
|
|
|
const navigate = useNavigate()
|
|
|
|
@ -52,12 +53,19 @@ function AuthApp() {
|
|
|
|
|
loadPageSpy(loginUser.username)
|
|
|
|
|
connectWebsocket(loginUser.userId)
|
|
|
|
|
fetchInitialData(loginUser)
|
|
|
|
|
startEmailInterval(loginUser.userId)
|
|
|
|
|
}
|
|
|
|
|
return () => {
|
|
|
|
|
disconnectWebsocket()
|
|
|
|
|
}
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
const startEmailInterval = (userId) => {
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
getEmailFetchAction({opi_sn: userId})
|
|
|
|
|
}, 1000*60)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uploadLog = () => {
|
|
|
|
|
if (window.$pageSpy) {
|
|
|
|
|
window.$pageSpy.triggerPlugins('onOfflineLog', 'upload')
|
|
|
|
|