Mercurial > gemma
diff 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 |
line wrap: on
line diff
--- a/client/src/store/imports.js Thu Nov 22 16:54:39 2018 +0100 +++ b/client/src/store/imports.js Thu Nov 22 17:00:26 2018 +0100 @@ -15,11 +15,17 @@ import { HTTP } from "../lib/http"; -const Imports = { +// initial state +const init = () => { + return { + imports: {} + }; +}; + +export default { + init, namespaced: true, - state: { - imports: {} - }, + state: init(), mutations: { setImports: (state, imports) => { state.imports = imports; @@ -42,5 +48,3 @@ } } }; - -export default Imports;