projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NOTICKET: Adding checks to code where necessary
[osm/UI.git]
/
skyquake
/
framework
/
widgets
/
skyquake_container
/
skyquakeContainerStore.js
diff --git
a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js
b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js
index
07010cd
..
4f27094
100644
(file)
--- 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();
});
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) => {
} catch(e) {
console.log('HIT an exception in openProjectSocketSuccess', e);
}
};
}
getUserProfileSuccess = (user) => {
+ this.alt.actions.global.hideScreenLoader.defer();
this.setState({user})
}
this.setState({user})
}
+ selectActiveProjectSuccess = (projectId) => {
+ let user = this.user;
+ user.projectId = projectId;
+ this.setState({user});
+ window.location.reload(true);
+ }
//Notifications
showNotification = (data) => {
let state = {
//Notifications
showNotification = (data) => {
let state = {
@@
-201,7
+212,8
@@
class SkyquakeContainerStore {
if(typeof(data) == 'string') {
} else {
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;
}
if(data.type) {
state.notificationType = data.type;
}