BIG-117: fix dashboard redirect all routes to homepage once refresh the page.

This commit is contained in:
a.bouhuolia
2021-09-23 09:44:30 +02:00
parent 8864e89674
commit 364859a793
13 changed files with 205 additions and 103 deletions

View File

@@ -3,11 +3,13 @@ import { useCallback } from 'react';
import { isAuthenticated } from 'store/authentication/authentication.reducer';
import {
setLogin,
setStoreReset,
} from 'store/authentication/authentication.actions';
import { useQueryClient } from 'react-query';
import { removeCookie } from '../../utils';
/**
* Removes the authentication cookies.
*/
function removeAuthenticationCookies() {
removeCookie('token');
removeCookie('organization_id');

View File

@@ -1,6 +1,10 @@
import { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { dashboardPageTitle } from 'store/dashboard/dashboard.actions';
import {
splashStopLoading,
splashStartLoading,
dashboardPageTitle,
} from '../../store/dashboard/dashboard.actions';
export const useDispatchAction = (action) => {
const dispatch = useDispatch();
@@ -17,11 +21,12 @@ export const useDashboardPageTitle = () => {
return useDispatchAction(dashboardPageTitle);
};
export const useSetAccountsTableQuery = () => {
/**
* Splash loading screen actions.
*/
export const useSplashLoading = () => {
return [
useDispatchAction(splashStartLoading),
useDispatchAction(splashStopLoading),
];
};
export const useAccountsTableQuery = () => {
}