@abihealth/goapp-react-native 1.28.0 → 1.29.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.29.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.28.0...goapp-react-native-v1.29.0) (2025-05-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * add caret to axios dependency ([#192](https://github.com/abiglobalhealth/react-native-sdk/issues/192)) ([7088968](https://github.com/abiglobalhealth/react-native-sdk/commit/70889683a39d9e02447cb568bec2fb6009f7129b))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handle consultation ended event with consultation object ([#195](https://github.com/abiglobalhealth/react-native-sdk/issues/195)) ([e582aaa](https://github.com/abiglobalhealth/react-native-sdk/commit/e582aaa5f257b5e2da36eeb5ba6f4910ff23b8b9))
14
+
3
15
  ## [1.28.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.27.0-beta...goapp-react-native-v1.28.0) (2025-05-09)
4
16
 
5
17
 
@@ -1,3 +1,4 @@
1
+ import { ConsultationContextProps } from '../contexts/ConsultationContext';
1
2
  import { Consultation } from '../types/consultation';
2
3
  import { CONSULTATION_EVENT, EventCallback } from '../types/events';
3
4
  export interface EventHandlers {
@@ -13,4 +14,4 @@ export interface EventHandlers {
13
14
  onConsultationEnded?: EventCallback;
14
15
  }
15
16
  export declare const mapConsultationStatusToEvent: (consultation: Consultation) => CONSULTATION_EVENT;
16
- export declare const handleEvent: (consultation: Consultation, eventHandlers?: EventHandlers) => void;
17
+ export declare const handleEvent: (consultation: ConsultationContextProps["consultation"], eventHandlers?: EventHandlers) => void;
@@ -28,6 +28,8 @@ var handleEvent = function (consultation, eventHandlers) {
28
28
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
29
29
  if (!eventHandlers)
30
30
  return;
31
+ if (!consultation)
32
+ return console.warn('Skipping event handling -> no consultation found');
31
33
  var consultationEvent = (0, exports.mapConsultationStatusToEvent)(consultation);
32
34
  switch (consultationEvent) {
33
35
  case events_1.CONSULTATION_EVENT.CANCELED:
@@ -87,7 +87,7 @@ var RatingScreen = function (_a) {
87
87
  var t = (0, useTranslation_1.useTranslation)().t;
88
88
  var theme = (0, useTheme_1.useTheme)();
89
89
  var styles = getStyles(theme);
90
- var _b = (0, useConsultation_1.useConsultation)(), rate = _b.rate, updateConsultation = _b.updateConsultation;
90
+ var _b = (0, useConsultation_1.useConsultation)(), rate = _b.rate, consultation = _b.consultation, updateConsultation = _b.updateConsultation;
91
91
  var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
92
92
  var _d = react_1.default.useState(null), selectedRating = _d[0], setSelectedRating = _d[1];
93
93
  var _e = (0, react_1.useState)(false), showError = _e[0], setShowError = _e[1];
@@ -107,6 +107,7 @@ var RatingScreen = function (_a) {
107
107
  startShake();
108
108
  }, [showError]);
109
109
  var handleRate = function () { return __awaiter(void 0, void 0, void 0, function () {
110
+ var updatedConsultation;
110
111
  return __generator(this, function (_a) {
111
112
  switch (_a.label) {
112
113
  case 0:
@@ -120,9 +121,9 @@ var RatingScreen = function (_a) {
120
121
  setLoading(true);
121
122
  return [4 /*yield*/, rate(selectedRating)];
122
123
  case 2:
123
- _a.sent();
124
+ updatedConsultation = _a.sent();
125
+ onConsultationEnded === null || onConsultationEnded === void 0 ? void 0 : onConsultationEnded(updatedConsultation);
124
126
  updateConsultation(null);
125
- onConsultationEnded === null || onConsultationEnded === void 0 ? void 0 : onConsultationEnded(null);
126
127
  return [3 /*break*/, 4];
127
128
  case 3:
128
129
  setLoading(false);
@@ -132,8 +133,8 @@ var RatingScreen = function (_a) {
132
133
  });
133
134
  }); };
134
135
  var handleSkip = function () {
136
+ onConsultationEnded === null || onConsultationEnded === void 0 ? void 0 : onConsultationEnded(consultation);
135
137
  updateConsultation(null);
136
- onConsultationEnded === null || onConsultationEnded === void 0 ? void 0 : onConsultationEnded(null);
137
138
  };
138
139
  return (<ScreenWrapper_1.ScreenWrapper header={<ConsultationHeader_1.ConsultationHeader />} containerStyle={styles.container}>
139
140
  <react_native_1.View style={styles.innerContainer}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abihealth/goapp-react-native",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -15,7 +15,7 @@
15
15
  "main": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts",
17
17
  "dependencies": {
18
- "axios": "1.7.9",
18
+ "axios": "^1.8.0",
19
19
  "i18next": "23.16.8",
20
20
  "phone": "3.1.58",
21
21
  "react-i18next": "14.1.3",