diff options
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/plugin.tsx')
-rw-r--r-- | sdnr/wt/odlux/apps/connectApp/src/plugin.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx index 4da33e0af..c9c11820e 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx @@ -9,7 +9,8 @@ import ConnectApplication from './views/connectView'; import { addMountedNetworkElementAsyncActionCreator, - updateMountedNetworkElementAsyncActionCreator + updateMountedNetworkElementAsyncActionCreator, + loadAllMountedNetworkElementsAsync } from './actions/mountedNetworkElementsActions'; import { AddSnackbarNotification } from '../../../framework/src/actions/snackbarActions'; @@ -30,14 +31,15 @@ export function register() { menuEntry: "Connect" }); + applicationApi.applicationStoreInitialized.then(applicationStore => { applicationStore.dispatch(loadAllMountedNetworkElementsAsync); }); // subscribe to the websocket notifications - subscribe<ObjectNotification & IFormatedMessage>(["ObjectCreationNotification", "ObjectDeletionNotification","AttributeValueChangedNotification"], (msg => { - const store = applicationApi && applicationApi.applicationStore; + subscribe<ObjectNotification & IFormatedMessage>(["ObjectCreationNotification", "ObjectDeletionNotification", "AttributeValueChangedNotification"], (msg => { + const store = applicationApi.applicationStore; if (msg && msg.notifType === "ObjectCreationNotification" && store) { store.dispatch(addMountedNetworkElementAsyncActionCreator(msg.objectId)); - store.dispatch(new AddSnackbarNotification({ message: `Adding network element [${ msg.objectId }]`, options: { variant: 'info' } })); + store.dispatch(new AddSnackbarNotification({ message: `Adding network element [${msg.objectId}]`, options: { variant: 'info' } })); } else if (msg && (msg.notifType === "ObjectDeletionNotification" || msg.notifType === "AttributeValueChangedNotification") && store) { - store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${ msg.objectId }]`, options: { variant: 'info' } })); + store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${msg.objectId}]`, options: { variant: 'info' } })); store.dispatch(updateMountedNetworkElementAsyncActionCreator(msg.objectId)); } })); |