X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainerStore.js;h=4f270945abffa8a7671253f92404337fbd3c8d74;hb=267d43e391d633c26d45db31125612355665f193;hp=07010cde57c066a60d7ad11ab0a8f529b394e87a;hpb=abf00ef39ee93f2a7ff05a4432eb3a50a88a487e;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js index 07010cde5..4f270945a 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js @@ -178,18 +178,29 @@ class SkyquakeContainerStore { Utils.checkAuthentication(data.statusCode, function() { self.closeSocket(); }); - - self.setState({ - projects: data.project - }); + if (!_.isEqual(data.project, self.projects)) { + let user = self.user; + user.projects = data.project; + self.setState({ + user: user, + projects: data.project + }); + } } catch(e) { console.log('HIT an exception in openProjectSocketSuccess', e); } }; } getUserProfileSuccess = (user) => { + this.alt.actions.global.hideScreenLoader.defer(); this.setState({user}) } + selectActiveProjectSuccess = (projectId) => { + let user = this.user; + user.projectId = projectId; + this.setState({user}); + window.location.reload(true); + } //Notifications showNotification = (data) => { let state = { @@ -201,7 +212,8 @@ class SkyquakeContainerStore { if(typeof(data) == 'string') { } else { - state.notificationMessage = data.msg; + if(!data) data = {}; + state.notificationMessage = data.msg || 'Something wrong occurred. Check the network tab and console logs for more information.'; if(data.type) { state.notificationType = data.type; }