MCPcopy Create free account
hub / github.com/bugy/script-server / init

Function init

web-src/src/main-app/store/scripts.js:17–32  ·  view source on GitHub ↗
({commit, dispatch})

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected