Skip to content

Instantly share code, notes, and snippets.

@okaygenc
Created December 12, 2021 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okaygenc/82e629f1923bf274b38edc54c92dcc33 to your computer and use it in GitHub Desktop.
Save okaygenc/82e629f1923bf274b38edc54c92dcc33 to your computer and use it in GitHub Desktop.
wander-app-after-hackathon.patch
diff --git a/src/api/index.ts b/src/api/index.ts
index 42d6ca9..b8462a1 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -3,7 +3,7 @@ import { Keyboard } from 'react-native'
import { store } from '../redux/store'
import { WandId } from '../screens/Wand'
-const baseURL = 'https://api.wanderapp.cf/'
+const baseURL = 'https://api2.wanderapp.cf/'
axios.interceptors.request.use(
async (config: any) => {
diff --git a/src/components/PointDetector.tsx b/src/components/PointDetector.tsx
index 4a14a21..a8aeabe 100644
--- a/src/components/PointDetector.tsx
+++ b/src/components/PointDetector.tsx
@@ -81,7 +81,7 @@ class PointDetector extends React.PureComponent {
interval /= 1000 // ms to s
this.dataState = calculateNextState(this.dataState, interval, rawData)
if (currDate - this.lastPointDate > 100) {
- this.points.push([-this.dataState.x.int2, this.dataState.z.int2])
+ this.points.push([-this.dataState.z.int2, this.dataState.x.int2])
this.lastPointDate = currDate
}
}
diff --git a/src/screens/StartMagic/index.tsx b/src/screens/StartMagic/index.tsx
index 2f4b4ed..b24ebd4 100644
--- a/src/screens/StartMagic/index.tsx
+++ b/src/screens/StartMagic/index.tsx
@@ -64,7 +64,6 @@ const StartMagicScreen = ({ navigation, route }: StackScreenProps): JSX.Element
points: points,
}
- // console.log('points', points)
setLoading(true)
try {
const res = await spellCheck(req)
@@ -75,14 +74,15 @@ const StartMagicScreen = ({ navigation, route }: StackScreenProps): JSX.Element
setYourMagic(resultData.drawnImage)
}
if (resultData.isSimilar) {
- dispatch(user)
+ dispatch(user(resultData.user))
+ Alert.alert('WIN GO TO NEXT CHAPTER')
return
}
setIsVisible(true)
setLetsStart(true)
}
} catch (err: any) {
- console.log('ERR', err)
+ console.log('ERR', err.reponse.data)
Alert.alert(err.message)
} finally {
setLoading(false)
@@ -104,13 +104,7 @@ const StartMagicScreen = ({ navigation, route }: StackScreenProps): JSX.Element
<HPText variant="body" margin={{ marginBottom: SPACING.TINY }}>
Your Magic
</HPText>
- {Boolean(
- yourMagic ? (
- <Image source={{ uri: yourMagic }} style={{ aspectRatio: 3 / 1 }} resizeMode="contain" />
- ) : (
- <View />
- ),
- )}
+ <Image source={{ uri: yourMagic }} style={{ height: 100 }} resizeMode="contain" />
<View />
</View>
<PointDetector ref={pointDetector} />
@LeviPesin
Copy link

There is a typo on the line 53 of the patch - there should be written response, not reponse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment