@umituz/react-native-ai-generation-content 1.82.0 → 1.82.2
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-ai-generation-content",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.2",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -151,8 +151,11 @@ export const WizardFlowContent: React.FC<WizardFlowContentProps> = (props) => {
|
|
|
151
151
|
hasImageInput,
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
//
|
|
155
|
-
|
|
154
|
+
// Validate: must be a positive finite integer
|
|
155
|
+
if (!Number.isFinite(result) || result <= 0) {
|
|
156
|
+
return creditCost;
|
|
157
|
+
}
|
|
158
|
+
return Math.ceil(result);
|
|
156
159
|
}, [customData, featureConfig.steps, validatedScenario.outputType, validatedScenario.inputType, calculateCredits, creditCost]);
|
|
157
160
|
|
|
158
161
|
const handlers = useWizardFlowHandlers({
|
|
@@ -120,8 +120,8 @@ export class GenerationOrchestrator {
|
|
|
120
120
|
try {
|
|
121
121
|
const actualUserId = this.requireAuthenticatedUser();
|
|
122
122
|
await this.config.creditService.add(actualUserId, amount);
|
|
123
|
-
} catch {
|
|
124
|
-
|
|
123
|
+
} catch (refundError) {
|
|
124
|
+
console.error("[GenerationOrchestrator] REFUND FAILED - user may have lost credits. Amount:", amount, "Error:", refundError);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|