Update ODLUX
[ccsdk/features.git] / sdnr / wt / odlux / framework / src / app.tsx
index ada78b9..a73b752 100644 (file)
@@ -26,7 +26,7 @@ import { Frame } from './views/frame';
 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
@@ -34,11 +34,12 @@ import { ApplicationStoreProvider } from './flux/connect';
 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
@@ -64,12 +65,15 @@ export { configureApplication } from "./handlers/applicationStateHandler";
 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
@@ -86,10 +90,10 @@ export const runApplication = () => {
     // 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