MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / handler

Function handler

src/pages/plugin/plugin.js:274–295  ·  view source on GitHub ↗
({ module, action, value })

Source from the content-addressed store, hash-verified

272 if (!purchaseHandlerSet) {
273 purchaseHandlerSet = true;
274 const handler = async ({ module, action, value }) => {
275 if (module === "plugin" && action === "purchased" && value === id) {
276 loader.show();
277
278 try {
279 const pluginData = await fsOperation(
280 config.API_BASE,
281 `plugin/${id}`,
282 ).readFile("json");
283
284 purchased = pluginData.owned;
285 render();
286 } catch (error) {
287 window.log(error);
288 helpers.error(error);
289 }
290
291 loader.hide();
292 purchaseHandlerSet = false;
293 removeIntentHandler(handler);
294 }
295 };
296 addIntentHandler(handler);
297 cleanups.push(() => removeIntentHandler(handler));
298 }

Callers 1

HandleIntentFunction · 0.85

Calls 9

removeIntentHandlerFunction · 0.90
fsOperationFunction · 0.85
logMethod · 0.80
renderFunction · 0.70
uninstallFunction · 0.70
showMethod · 0.45
readFileMethod · 0.45
errorMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected