({commit, dispatch})
| 15 | |
| 16 | actions: { |
| 17 | init({commit, dispatch}) { |
| 18 | router.afterEach((to, from) => { |
| 19 | dispatch('selectScriptByHash'); |
| 20 | }); |
| 21 | |
| 22 | axiosInstance.get('scripts') |
| 23 | .then(({data}) => { |
| 24 | const {scripts} = data; |
| 25 | scripts.sort(function (script1, script2) { |
| 26 | return script1.name.toLowerCase().localeCompare(script2.name.toLowerCase()); |
| 27 | }); |
| 28 | |
| 29 | commit('SET_SCRIPTS', scripts); |
| 30 | dispatch('selectScriptByHash'); |
| 31 | }); |
| 32 | }, |
| 33 | |
| 34 | selectScriptByHash({state, commit}) { |
| 35 | let encodedScriptName; |