Mercurial > gemma
comparison client/src/store/imports.js @ 1296:99c039e86624
replaced manual store cleanup on logout with central store reset
The store files now provide a init method with which the store can be resetted on logout.
This is reasonable because missing store cleanups on logout caused bugs.
Furthermore the localStorage.clear() was replaced specific removal of values since currently there are also
saved cross profiles which should be persistent.
The initialization of the cut/line/polygon tool was moved from their respective buttons to the map store
right after saving the ol map object in the store. Before that change the map object was not present sometimes
when trying to initiate those tools.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 17:00:26 +0100 |
parents | bc55ffaeb639 |
children | d675e6439aa5 |
comparison
equal
deleted
inserted
replaced
1295:cf041cf30418 | 1296:99c039e86624 |
---|---|
13 * Thomas Junk <thomas.junk@intevation.de> | 13 * Thomas Junk <thomas.junk@intevation.de> |
14 */ | 14 */ |
15 | 15 |
16 import { HTTP } from "../lib/http"; | 16 import { HTTP } from "../lib/http"; |
17 | 17 |
18 const Imports = { | 18 // initial state |
19 const init = () => { | |
20 return { | |
21 imports: {} | |
22 }; | |
23 }; | |
24 | |
25 export default { | |
26 init, | |
19 namespaced: true, | 27 namespaced: true, |
20 state: { | 28 state: init(), |
21 imports: {} | |
22 }, | |
23 mutations: { | 29 mutations: { |
24 setImports: (state, imports) => { | 30 setImports: (state, imports) => { |
25 state.imports = imports; | 31 state.imports = imports; |
26 } | 32 } |
27 }, | 33 }, |
40 }); | 46 }); |
41 }); | 47 }); |
42 } | 48 } |
43 } | 49 } |
44 }; | 50 }; |
45 | |
46 export default Imports; |