PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | src/Shared/components/ProductAccountActivation/usePluginsActivation.js +10 -1 3.1.6 → 3.2.2 View file →
@@ -10,8 +10,14 @@
10 10 completed: 'completed',
11 11 skipped: 'skipped',
12 12 };
13 13
14 +export const ACCOUNT_STATUS = {
15 + pending: 'pending',
16 + success: 'success',
17 + error: 'error',
18 +};
19 +
14 20 export const getPluginsScriptData = async ([slugs, ineligible]) => {
15 21 const params = new URLSearchParams(slugs.map((slug) => ['plugins', slug]));
16 22 for (const slug of ineligible) {
17 23 params.append('ineligible', slug);
@@ -29,8 +35,9 @@
29 35 selectedPlugins,
30 36 status,
31 37 context,
32 38 }) => {
39 + // Losing this record must not cost the account it was recording.
33 40 await fetch(`${AI_HOST}/api/plugins/activate`, {
34 41 method: 'PATCH',
35 42 headers: { 'Content-Type': 'application/json' },
36 43 body: JSON.stringify({
@@ -39,9 +46,11 @@
39 46 selectedPlugins,
40 47 status,
41 48 context,
42 49 }),
43 - });
50 + // The copy invites closing the window; the settled write has to outlive it.
51 + keepalive: true,
52 + }).catch(() => {});
44 53 };
45 54
46 55 export const usePluginsActivation = (plugins, ineligible = []) => {
47 56 const slugs = plugins.map((plugin) => plugin.slug);