Mercurial > gemma
comparison client/src/store/usermanagement.js @ 3670:2c0170be6cf0 configuration
usermanagement: return an empty list of user countries in case the user is logged out and the object is not present
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 12:29:20 +0200 |
parents | 081182dfcc35 |
children | 2261462ddcdc |
comparison
equal
deleted
inserted
replaced
3642:6bb8def12f20 | 3670:2c0170be6cf0 |
---|---|
40 init, | 40 init, |
41 namespaced: true, | 41 namespaced: true, |
42 state: init(), | 42 state: init(), |
43 getters: { | 43 getters: { |
44 userCountries: state => { | 44 userCountries: state => { |
45 if (!state.users) return []; | |
45 return state.users.reduce((o, n) => { | 46 return state.users.reduce((o, n) => { |
46 o[n.user] = n.role !== "sys_admin" ? n.country : "global"; | 47 o[n.user] = n.role !== "sys_admin" ? n.country : "global"; |
47 return o; | 48 return o; |
48 }, {}); | 49 }, {}); |
49 }, | 50 }, |