@virgodev/iap 1.0.4 → 1.0.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.
@@ -58,14 +58,7 @@ onMounted(() => {});
58
58
 
59
59
  function closeDialog(v: boolean): void {
60
60
  if (v === false) {
61
- if (iap.stripe.callback) {
62
- iap.stripe.callback(undefined);
63
- }
64
- iap.stripe.callback = undefined;
65
- iap.stripe.result = undefined;
66
- iap.stripe.cart = undefined;
67
- iap.stripe.status = undefined;
68
- iap.stripe.error = undefined;
61
+ iap.stripe.reset();
69
62
  visible.value = false;
70
63
  }
71
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virgodev/iap",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "./index.ts",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/stores/iap.ts CHANGED
@@ -286,6 +286,17 @@ export const useIapStore = defineStore("iap", () => {
286
286
  });
287
287
  }
288
288
 
289
+ function reset() {
290
+ if (stripeCallback.value) {
291
+ stripeCallback.value(undefined);
292
+ }
293
+ stripeCallback.value = undefined;
294
+ stripeResult.value = undefined;
295
+ stripeCart.value = undefined;
296
+ stripeStatus.value = undefined;
297
+ stripeError.value = undefined;
298
+ }
299
+
289
300
  return {
290
301
  products,
291
302
  platform,
@@ -307,6 +318,7 @@ export const useIapStore = defineStore("iap", () => {
307
318
  result: stripeResult,
308
319
  callback: stripeCallback,
309
320
  error: stripeError,
321
+ reset,
310
322
  },
311
323
  };
312
324
  });