import { User } from './models/authentication';\r
\r
import { AddErrorInfoAction } from './actions/errorActions';\r
-import { UpdateUser } from './actions/authentication';\r
+import { loginUserAction } from './actions/authentication';\r
\r
import { applicationStoreCreator } from './store/applicationStore';\r
import { ApplicationStoreProvider } from './flux/connect';\r
import { startHistoryListener } from './middleware/navigation';\r
import { startRestService } from './services/restService';\r
\r
-import { startForceLogoutService } from './services/forceLogoutService';\r
+import { startUserSessionService } from './services/userSessionService';\r
import { startNotificationService } from './services/notificationService';\r
\r
import theme from './design/default';\r
import '!style-loader!css-loader!./app.css';\r
+import { startBroadcastChannel } from './services/broadcastService';\r
\r
declare module '@material-ui/core/styles/createMuiTheme' {\r
\r
export const transportPCEUrl = "transportPCEUrl";\r
\r
export const runApplication = () => {\r
-\r
+ \r
const initialToken = localStorage.getItem("userToken");\r
const applicationStore = applicationStoreCreator();\r
\r
+ startBroadcastChannel(applicationStore);\r
+ startUserSessionService(applicationStore);\r
+ \r
if (initialToken) {\r
- applicationStore.dispatch(new UpdateUser(User.fromString(initialToken) || undefined));\r
+ applicationStore.dispatch(loginUserAction(User.fromString(initialToken) || undefined));\r
}\r
\r
window.onerror = function (msg: string, url: string, line: number, col: number, error: Error) {\r
// Internet Explorer) will be suppressed.\r
return suppressErrorAlert;\r
};\r
+ \r
\r
startRestService(applicationStore);\r
startHistoryListener(applicationStore);\r
- startForceLogoutService(applicationStore);\r
startNotificationService(applicationStore);\r
\r
const App = (): JSX.Element => (\r