Skip to content

Commit e43bb91

Browse files
committed
fix: image loader, navigation, ..
1 parent 2078913 commit e43bb91

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

mobile/api/gen/src/runtime.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
*/
1414

1515
import Constants from "expo-constants";
16-
import { IS_DEVELOPMENT_BUILD } from "../../../utils/env.utils";
1716

1817
export const BASE_PATH = (
19-
(IS_DEVELOPMENT_BUILD
18+
(false // TODO
2019
? `http://${Constants.expoConfig?.hostUri?.split(":").shift()?.concat(":3000")}`
2120
: "https://api.offlinery.io") + "/v1"
2221
).replace(/\/+$/, "");

mobile/components/OEncounterList/OEncounterList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const OEncounterList = (props: IOEncounterListProps) => {
109109

110110
const getEncounterList = () => {
111111
if (encounterState.isWalkthroughRunning) {
112-
return <OTourEncounter />;
112+
return <OTourEncounter navigation={navigation} />;
113113
} else {
114114
return encounterState.encounters.length > 0 ? (
115115
encounterState.encounters.map((encounter, idx) => (

mobile/components/OImageWithLoader/OImageWithLoader.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { Color } from "@/GlobalStyles";
2+
import * as Sentry from "@sentry/react-native";
23
import React, { useCallback, useState } from "react";
34
import {
45
ActivityIndicator,
56
Image,
7+
ImageErrorEventData,
68
ImageProps,
9+
NativeSyntheticEvent,
710
StyleSheet,
811
View,
912
} from "react-native";
@@ -13,19 +16,26 @@ interface OImageWithLoaderProps extends ImageProps {
1316
}
1417

1518
export const OImageWithLoader = (props: OImageWithLoaderProps) => {
16-
const [isLoading, setIsLoading] = useState(false);
19+
const [isLoading, setIsLoading] = useState(true);
1720

18-
const handleLoadStart = useCallback(() => {
21+
const handleLoadStart = () => {
1922
setIsLoading(true);
20-
}, []);
23+
};
2124

22-
const handleLoadEnd = useCallback(() => {
25+
const handleLoadEnd = () => {
2326
setIsLoading(false);
24-
}, []);
27+
};
2528

26-
const handleError = useCallback(() => {
27-
setIsLoading(false);
28-
}, []);
29+
const handleError = useCallback(
30+
(err: NativeSyntheticEvent<ImageErrorEventData>) => {
31+
Sentry.captureException(err, {
32+
tags: {
33+
imageWithLoader: "handleError",
34+
},
35+
});
36+
},
37+
[],
38+
);
2939

3040
return (
3141
<View style={[styles.container, props.style]}>

0 commit comments

Comments
 (0)