@kirby-tools/licensing 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/license.d.ts CHANGED
@@ -18,9 +18,7 @@ declare function useLicense(licenseOptions: LicenseOptions): {
18
18
  component: MaybeRef<ComponentPublicInstance | null | undefined>;
19
19
  licenseStatus: MaybeRef<LicenseStatus>;
20
20
  }) => void;
21
- openLicenseModal: () => Promise<{
22
- isLicenseActive: boolean;
23
- }>;
21
+ openLicenseModal: () => Promise<void>;
24
22
  };
25
23
  //#endregion
26
24
  export { LicenseModalResult, LicenseOptions, useLicense };
package/dist/license.js CHANGED
@@ -9,7 +9,8 @@ function useLicense(licenseOptions) {
9
9
  const isLocalhost = isLocalHost();
10
10
  const openLicenseModal = async () => {
11
11
  const { label } = licenseOptions;
12
- return { isLicenseActive: (await openFieldsDialog({
12
+ let isSubmitting = false;
13
+ await openFieldsDialog({
13
14
  submitButton: {
14
15
  icon: "check",
15
16
  theme: "love",
@@ -31,14 +32,18 @@ function useLicense(licenseOptions) {
31
32
  }
32
33
  },
33
34
  onSubmit: async (value) => {
34
- const isLicenseActive = await activateLicense(value, licenseOptions);
35
- if (!isLicenseActive) return false;
35
+ if (isSubmitting) return false;
36
+ isSubmitting = true;
37
+ if (!await activateLicense(value, licenseOptions)) {
38
+ isSubmitting = false;
39
+ return false;
40
+ }
36
41
  panel.notification.success(t("notification.success"));
37
42
  await new Promise((resolve) => setTimeout(resolve, 750));
38
43
  window.location.reload();
39
- return { isLicenseActive };
44
+ return new Promise(() => {});
40
45
  }
41
- }))?.isLicenseActive ?? false };
46
+ });
42
47
  };
43
48
  const assertActivationIntegrity = ({ component, licenseStatus }) => {
44
49
  if (unref(licenseStatus) === "active") return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirby-tools/licensing",
3
3
  "type": "module",
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "packageManager": "pnpm@10.28.0",
6
6
  "description": "License system for Kirby Tools plugins within the Kirby Panel",
7
7
  "author": "Johann Schopplich <hello@johannschopplich.com>",