@umituz/react-native-settings 4.23.15 → 4.23.17
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-settings",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.17",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -63,12 +63,25 @@ export const SupportSection: React.FC<SupportSectionProps> = ({
|
|
|
63
63
|
const handleFeedbackSubmit = async (data: { type: any; rating: number; description: string; title: string }) => {
|
|
64
64
|
if (feedbackConfig.config?.onSubmit) {
|
|
65
65
|
setIsSubmitting(true);
|
|
66
|
-
setModalVisible(false);
|
|
67
66
|
try {
|
|
68
|
-
|
|
67
|
+
// Add a small delay for better UX if needed, or remove it if instant response is preferred
|
|
68
|
+
// await new Promise(resolve => setTimeout(resolve, 300));
|
|
69
69
|
await feedbackConfig.config.onSubmit(data);
|
|
70
|
-
|
|
71
|
-
//
|
|
70
|
+
|
|
71
|
+
// Only close on success - or let the parent handle it?
|
|
72
|
+
// Since onSubmit in config returns Promise<void> and usually handles errors via callbacks (onError),
|
|
73
|
+
// we can assume if it resolves, we should close.
|
|
74
|
+
// If the App's onSubmit logic catches errors and resolves, we still close.
|
|
75
|
+
setModalVisible(false);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
// If the passed onSubmit throws, we log it.
|
|
78
|
+
if (__DEV__) {
|
|
79
|
+
console.error("[SupportSection] Feedback submission error:", error);
|
|
80
|
+
}
|
|
81
|
+
// Optionally keep modal open? Or close it?
|
|
82
|
+
// If we keep it open, user can retry.
|
|
83
|
+
// But usually we close it.
|
|
84
|
+
setModalVisible(false);
|
|
72
85
|
} finally {
|
|
73
86
|
setIsSubmitting(false);
|
|
74
87
|
}
|