@umituz/react-native-subscription 2.37.9 → 2.37.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.37.
|
|
3
|
+
"version": "2.37.10",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -4,6 +4,7 @@ import { getCreditsRepository } from "../../infrastructure/CreditsRepositoryMana
|
|
|
4
4
|
import type { UseDeductCreditParams, UseDeductCreditResult } from "./types";
|
|
5
5
|
import type { DeductCreditsResult } from "../../core/Credits";
|
|
6
6
|
import { createDeductCreditMutationConfig, type MutationContext } from "./mutationConfig";
|
|
7
|
+
import { creditsQueryKeys } from "../creditsQueryKeys";
|
|
7
8
|
|
|
8
9
|
export const useDeductCredit = ({
|
|
9
10
|
userId,
|
|
@@ -51,7 +52,7 @@ export const useDeductCredit = ({
|
|
|
51
52
|
const result = await repository.refundCredit(userId, amount);
|
|
52
53
|
if (result.success) {
|
|
53
54
|
// Invalidate queries to refresh credit balance
|
|
54
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
55
|
+
await queryClient.invalidateQueries({ queryKey: creditsQueryKeys.user(userId) });
|
|
55
56
|
return true;
|
|
56
57
|
}
|
|
57
58
|
return false;
|
|
@@ -8,7 +8,7 @@ export interface SubscriptionInitModuleConfig extends Omit<SubscriptionInitConfi
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function createSubscriptionInitModule(config: SubscriptionInitModuleConfig): InitModule {
|
|
11
|
-
const { getApiKey, critical =
|
|
11
|
+
const { getApiKey, critical = false, dependsOn = ['auth'], ...subscriptionConfig } = config;
|
|
12
12
|
|
|
13
13
|
return {
|
|
14
14
|
name: 'subscription',
|