mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fix issue where a hard refresh wouldn't work to clear the state due to the browser caching the html
This commit is contained in:
@@ -60,6 +60,7 @@ export function getDSOPath(dso: DSpaceObject): string {
|
||||
imports: [
|
||||
RouterModule.forRoot([
|
||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||
{ path: 'reload/:rnd', redirectTo: '/home', pathMatch: 'full' },
|
||||
{ path: 'home', loadChildren: './+home-page/home-page.module#HomePageModule', data: { showBreadcrumbs: false } },
|
||||
{ path: 'community-list', loadChildren: './community-list-page/community-list-page.module#CommunityListPageModule' },
|
||||
{ path: 'id', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' },
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { StoreActionTypes } from './store.actions';
|
||||
import { AuthActionTypes } from './core/auth/auth.actions';
|
||||
|
||||
// fallback ngrx debugger
|
||||
let actionCounter = 0;
|
||||
@@ -28,10 +29,26 @@ export function universalMetaReducer(reducer) {
|
||||
}
|
||||
}
|
||||
|
||||
// const clearStateActions = [
|
||||
// AuthActionTypes.LOG_OUT_SUCCESS,
|
||||
// ];
|
||||
//
|
||||
// export function clearStateMetaReducer(reducer) {
|
||||
// return function (state, action) {
|
||||
//
|
||||
// if (clearStateActions.includes(action.type)) {
|
||||
// state = {};
|
||||
// }
|
||||
//
|
||||
// return reducer(state, action);
|
||||
// };
|
||||
// }
|
||||
|
||||
export const debugMetaReducers = [
|
||||
debugMetaReducer
|
||||
];
|
||||
|
||||
export const appMetaReducers = [
|
||||
universalMetaReducer
|
||||
universalMetaReducer,
|
||||
// clearStateMetaReducer
|
||||
];
|
||||
|
@@ -460,8 +460,9 @@ export class AuthService {
|
||||
* Refresh route navigated
|
||||
*/
|
||||
public refreshAfterLogout() {
|
||||
// Hard redirect to home page, so that all state is definitely lost
|
||||
this._window.nativeWindow.location.href = '/home';
|
||||
// Hard redirect to the reload page with a unique number behind it
|
||||
// so that all state is definitely lost
|
||||
this._window.nativeWindow.location.href = `/reload/${new Date().getTime()}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user