X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainerStore.js;h=87651e59c6de46cc94d4b7ebe1b6c748f4bcd779;hb=9be8b4847b580cea9e28d2f2a02166753c29b58e;hp=cb731c73c6d808e61d31718809a2de4e22bfabbd;hpb=7302dfb98687690908844f331861aec374e95ed9;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js index cb731c73c..87651e59c 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js @@ -21,9 +21,11 @@ import Alt from './skyquakeAltInstance.js'; import SkyquakeContainerSource from './skyquakeContainerSource.js'; import SkyquakeContainerActions from './skyquakeContainerActions'; let Utils = require('utils/utils.js'); -import _ from 'lodash'; +import _indexOf from 'lodash/indexOf'; +import _isEqual from 'lodash/isEqual'; //Temporary, until api server is on same port as webserver -var rw = require('utils/rw.js'); +import rw from 'utils/rw.js'; + var API_SERVER = rw.getSearchParams(window.location).api_server; var UPLOAD_SERVER = rw.getSearchParams(window.location).upload_server; @@ -103,7 +105,7 @@ class SkyquakeContainerStore { } else { // Temp to test before adding multi-sources data.notification.source = streamSource; - if (_.indexOf(self.notifications, data.notification) == -1) { + if (_indexOf(self.notifications, data.notification) == -1) { // newly appreared event. // Add to the notifications list and setState self.notifications.unshift(data.notification); @@ -178,7 +180,7 @@ class SkyquakeContainerStore { Utils.checkAuthentication(data.statusCode, function() { self.closeSocket(); }); - if (!_.isEqual(data.project, self.projects)) { + if (!_isEqual(data.project, self.projects)) { let user = self.user; user.projects = data.project; self.setState({ @@ -199,7 +201,8 @@ class SkyquakeContainerStore { let user = this.user; user.projectId = projectId; this.setState({user}); - } + window.location.reload(true); + } //Notifications showNotification = (data) => { let state = { @@ -276,4 +279,4 @@ function getCurrentPlugin() { } } -export default Alt.createStore(SkyquakeContainerStore); +export default Alt.createStore(SkyquakeContainerStore, 'SkyquakeContainerStore');