From df99f8077691491d095729a11ce71fa1cf5bd18a Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 16:38:14 +0100 Subject: [PATCH 1/9] Update map library --- app/defikarte/package-lock.json | 8 ++++---- app/defikarte/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/defikarte/package-lock.json b/app/defikarte/package-lock.json index 22d82c8..b96bca2 100644 --- a/app/defikarte/package-lock.json +++ b/app/defikarte/package-lock.json @@ -29,7 +29,7 @@ "react-native": "0.72.5", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "1.7.1", + "react-native-maps": "^1.8.0", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", @@ -12479,9 +12479,9 @@ } }, "node_modules/react-native-maps": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.7.1.tgz", - "integrity": "sha512-CHVLzL+Q2jiUGgbt4/vosxVI1SukWyaLGjD62VLgR/wZpnH4Umi9ql1bmKDPWcfj2C1QZwMU0Yc7rXTbvZUIiw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.8.0.tgz", + "integrity": "sha512-KfVZ03L42+a22Fkcl2uDe5d+73BweTlcRUzm2G+aQUJ7fHrBxj7CuXWtKMSNpVDiO3YDCWcshiiyjSXxkd/qOw==", "dependencies": { "@types/geojson": "^7946.0.10" }, diff --git a/app/defikarte/package.json b/app/defikarte/package.json index 15c5ded..3fa02f2 100644 --- a/app/defikarte/package.json +++ b/app/defikarte/package.json @@ -30,7 +30,7 @@ "react-native": "0.72.5", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "1.7.1", + "react-native-maps": "^1.8.0", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", From 67dc3f8617775510d99fb07fb89d723a5123afd8 Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 16:58:25 +0100 Subject: [PATCH 2/9] Add openingHours validation and phonenumber validation #162 --- app/defikarte/package-lock.json | 6 ++ app/defikarte/package.json | 1 + app/defikarte/src/components/TextForm.js | 75 ++++++++----- app/defikarte/src/config/createForm.js | 131 +++++++++++++---------- 4 files changed, 127 insertions(+), 86 deletions(-) diff --git a/app/defikarte/package-lock.json b/app/defikarte/package-lock.json index b96bca2..10b2526 100644 --- a/app/defikarte/package-lock.json +++ b/app/defikarte/package-lock.json @@ -21,6 +21,7 @@ "expo-status-bar": "~1.6.0", "i18next": "^23.5.1", "intl-pluralrules": "^2.0.1", + "libphonenumber-js": "^1.10.49", "moment": "^2.29.4", "opening_hours": "^3.8.0", "react": "18.2.0", @@ -9928,6 +9929,11 @@ "node": ">=6" } }, + "node_modules/libphonenumber-js": { + "version": "1.10.49", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.49.tgz", + "integrity": "sha512-gvLtyC3tIuqfPzjvYLH9BmVdqzGDiSi4VjtWe2fAgSdBf0yt8yPmbNnRIHNbR5IdtVkm0ayGuzwQKTWmU0hdjQ==" + }, "node_modules/lightningcss": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.19.0.tgz", diff --git a/app/defikarte/package.json b/app/defikarte/package.json index 3fa02f2..ca929bf 100644 --- a/app/defikarte/package.json +++ b/app/defikarte/package.json @@ -22,6 +22,7 @@ "expo-status-bar": "~1.6.0", "i18next": "^23.5.1", "intl-pluralrules": "^2.0.1", + "libphonenumber-js": "^1.10.49", "moment": "^2.29.4", "opening_hours": "^3.8.0", "react": "18.2.0", diff --git a/app/defikarte/src/components/TextForm.js b/app/defikarte/src/components/TextForm.js index 78fba60..a628055 100644 --- a/app/defikarte/src/components/TextForm.js +++ b/app/defikarte/src/components/TextForm.js @@ -1,10 +1,23 @@ -import React, { useState } from 'react'; -import { View, Text, Switch, TextInput, StyleSheet } from 'react-native'; +import React, { useState } from "react"; +import { View, Text, Switch, TextInput, StyleSheet } from "react-native"; import { Controller } from "react-hook-form"; -const TextForm = ({ labelText, keyboardType, defaultValue, multiline, placeholder, useSwitch = false, name, control, rules, errors, errorMsg, disabled }) => { +const TextForm = ({ + labelText, + keyboardType, + defaultValue, + multiline, + placeholder, + useSwitch = false, + name, + control, + rules, + errors, + errorMsg, + disabled, +}) => { const [switchValue, setSwitchValue] = useState(false); - const [tempValue, setTempValue] = useState(''); + const [tempValue, setTempValue] = useState(""); const onSwitchChange = (newVal, value, setValue) => { setSwitchValue(newVal); @@ -12,16 +25,18 @@ const TextForm = ({ labelText, keyboardType, defaultValue, multiline, placeholde // if newVal from switch (bool) is true, use default value const val = newVal ? defaultValue : tempValue; setValue(val); - } + }; const defaultWithSwitch = (value, onChange) => { - const textStyle = switchValue ? styles.switchActiveLabelStyle : styles.switchLabelStyle; + const textStyle = switchValue + ? styles.switchActiveLabelStyle + : styles.switchLabelStyle; if (useSwitch) { return ( onSwitchChange(newVal, value, onChange)} + onValueChange={(newVal) => onSwitchChange(newVal, value, onChange)} value={switchValue} disabled={disabled} /> @@ -31,7 +46,7 @@ const TextForm = ({ labelText, keyboardType, defaultValue, multiline, placeholde } return null; - } + }; const showTextInput = (onChange, onBlur, value) => { if (!switchValue) { @@ -41,40 +56,44 @@ const TextForm = ({ labelText, keyboardType, defaultValue, multiline, placeholde value={value} onChangeText={onChange} onBlur={onBlur} - autoCapitalize='none' + autoCapitalize="none" keyboardType={keyboardType} - defaultValue={useSwitch ? '' : defaultValue} + defaultValue={useSwitch ? "" : defaultValue} multiline={multiline} autoGrow={true} placeholder={placeholder} autoCorrect={false} editable={!switchValue} - returnKeyType={multiline ? 'default' : 'done'} + returnKeyType={multiline ? "default" : "done"} /> ); } }; return ( - + { return ( <> - + {labelText} {defaultWithSwitch(field.value, field.onChange)} {showTextInput(field.onChange, field.onBlur, field.value)} - ) + ); }} /> - {(errors && errors[name]) && {errorMsg}} + {errors && errors[name] && ( + + {errorMsg ?? errors[name]?.message} + + )} ); }; @@ -86,23 +105,23 @@ const styles = StyleSheet.create({ marginVertical: 10, }, inlineSwitchStyle: { - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", }, labelStyle: { fontSize: 18, marginRight: 10, - color: 'rgba(70, 70, 70, 1)', + color: "rgba(70, 70, 70, 1)", }, inputStyle: { - borderColor: 'rgba(200, 200, 200, 1)', + borderColor: "rgba(200, 200, 200, 1)", borderBottomWidth: 1, fontSize: 18, padding: 5, }, switchContainerStyle: { - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", }, switchStyle: { marginRight: 10, @@ -111,19 +130,19 @@ const styles = StyleSheet.create({ switchLabelStyle: { fontSize: 16, marginRight: 10, - color: 'rgba(140, 140, 140, 1)', + color: "rgba(140, 140, 140, 1)", }, switchActiveLabelStyle: { fontSize: 16, marginRight: 10, - color: '#007AFF', - fontWeight: 'bold' + color: "#007AFF", + fontWeight: "bold", }, errorTextStyle: { fontSize: 16, - color: 'red', + color: "red", marginTop: 3, - } + }, }); -export default TextForm; \ No newline at end of file +export default TextForm; diff --git a/app/defikarte/src/config/createForm.js b/app/defikarte/src/config/createForm.js index 98dd545..88fc70e 100644 --- a/app/defikarte/src/config/createForm.js +++ b/app/defikarte/src/config/createForm.js @@ -1,96 +1,111 @@ -import opening_hours from 'opening_hours'; +import opening_hours from "opening_hours"; +import { + isPossiblePhoneNumber, + isValidPhoneNumber, + validatePhoneNumberLength, +} from "libphonenumber-js"; -const openingHoursValidation = value => { - let valid = false; +const openingHoursErrorsAndWarnings = (value) => { + let msg = ""; try { - let oh = new opening_hours(value); - valid = true; + const oh = new opening_hours(value); + const warnings = oh.getWarnings(); + msg = warnings.join(", "); } catch (error) { - valid = false; + msg = + "Die eingegebenen Öffnungzeiten entsprechen nicht dem geforderten Format."; } - return value == '' || valid; -} + return msg === "" || value === null || value === "" ? true : msg; +}; + +const phonenumberValidation = (value) => { + let valid = + isPossiblePhoneNumber(value) === true && + isValidPhoneNumber(value) === true && + validatePhoneNumberLength(value, "CH") === undefined; + + return valid; +}; export default [ { - name: 'reporter', + name: "reporter", rules: { required: true }, - type: 'Text', - label: 'Melder', - placeholder: 'Max Mustermann', - defaultValue: '', - errorMsg: 'Der Melder wird benötigt', + type: "Text", + label: "Melder", + placeholder: "Max Mustermann", + defaultValue: "", + errorMsg: "Der Melder wird benötigt", }, { - name: 'location', + name: "location", rules: { required: true, maxLength: 200 }, - type: 'Text', - label: 'Standort', - placeholder: 'Schulhaus Zürich West, neben Eingang', - defaultValue: '', - errorMsg: 'Der Standort wird benötigt, maximale Länge 200 Zeichen', + type: "Text", + label: "Standort", + placeholder: "Schulhaus Zürich West, neben Eingang", + defaultValue: "", + errorMsg: "Der Standort wird benötigt, maximale Länge 200 Zeichen", }, { - name: 'level', + name: "level", rules: { required: false }, - type: 'Text', - label: 'Stockwerk', - placeholder: '6. OG', - defaultValue: '', + type: "Text", + label: "Stockwerk", + placeholder: "6. OG", + defaultValue: "", }, { - name: 'description', + name: "description", rules: { required: false, maxLength: 200 }, - type: 'Text', - label: 'Beschreibung', - placeholder: 'z.B.: während Öffnungszeiten verfügbar', - defaultValue: '', + type: "Text", + label: "Beschreibung", + placeholder: "z.B.: während Öffnungszeiten verfügbar", + defaultValue: "", multiline: true, - errorMsg: 'Die maximale Länge beträgt 200 Zeichen', + errorMsg: "Die maximale Länge beträgt 200 Zeichen", }, /* not required es gibt diverse opening Hour validation tools. problem: es gibt sehr viele kombinationen, automatische opening hours validation wäre gut: https://wiki.openstreetmap.org/wiki/Key:opening_hours#Implementation*/ { - name: 'openingHours', - rules: { validate: openingHoursValidation }, - type: 'Text', - label: 'Öffnungszeiten', - placeholder: 'Mo-Fr: 08:00-17:00', - defaultValue: '24/7', + name: "openingHours", + rules: { validate: openingHoursErrorsAndWarnings }, + type: "Text", + label: "Öffnungszeiten", + placeholder: "Mo-Fr: 08:00-17:00", + defaultValue: "24/7", useSwitch: true, multiline: true, - errorMsg: 'Die eingegebenen Öffnungzeiten entsprechen nicht dem geforderten Format.', }, { - name: 'operator', + name: "operator", rules: { required: false }, - type: 'Text', - label: 'Betreiber', - placeholder: 'Gemeinde, Verein, Privatperson', - defaultValue: '', + type: "Text", + label: "Betreiber", + placeholder: "Gemeinde, Verein, Privatperson", + defaultValue: "", }, { - name: 'operatorPhone', - rules: { pattern: /^(\+41|0041|0)\s?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$/ }, - type: 'Text', - label: 'Telefon', - placeholder: '+41 79 000 00 00', - keyboardType: 'phone-pad', - defaultValue: '', - errorMsg: 'Der Wert muss eine gültige Telefonummer sein', + name: "operatorPhone", + rules: { validate: phonenumberValidation }, + type: "Text", + label: "Telefon", + placeholder: "+41 79 000 00 00", + keyboardType: "phone-pad", + defaultValue: "", + errorMsg: "Der Wert muss eine gültige Telefonummer sein", }, { - name: 'access', - type: 'Switch', - label: 'Zugänglich', + name: "access", + type: "Switch", + label: "Zugänglich", defaultValue: false, }, { - name: 'indoor', - type: 'Switch', - label: 'Im Gebäude', + name: "indoor", + type: "Switch", + label: "Im Gebäude", defaultValue: false, }, -] \ No newline at end of file +]; From 41a075d0d1dd4f5dc9a25462431feb9f41af11f0 Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 17:31:47 +0100 Subject: [PATCH 3/9] Fix phonenumber required issue --- app/defikarte/src/config/createForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/defikarte/src/config/createForm.js b/app/defikarte/src/config/createForm.js index 88fc70e..8175438 100644 --- a/app/defikarte/src/config/createForm.js +++ b/app/defikarte/src/config/createForm.js @@ -25,7 +25,7 @@ const phonenumberValidation = (value) => { isValidPhoneNumber(value) === true && validatePhoneNumberLength(value, "CH") === undefined; - return valid; + return value === null || value === "" || valid; }; export default [ @@ -88,7 +88,7 @@ export default [ }, { name: "operatorPhone", - rules: { validate: phonenumberValidation }, + rules: { validate: phonenumberValidation, required: false }, type: "Text", label: "Telefon", placeholder: "+41 79 000 00 00", From fff8c2f1224521945d79b4a2e85c46f95945477e Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 17:38:59 +0100 Subject: [PATCH 4/9] Add correct secret to environment var for google maps api key --- .github/workflows/app-deployment.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/app-deployment.yml b/.github/workflows/app-deployment.yml index 78872ef..3bde88f 100644 --- a/.github/workflows/app-deployment.yml +++ b/.github/workflows/app-deployment.yml @@ -1,20 +1,20 @@ name: Build iOS & Android -# Controls when the action will run. +# Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ development, main ] + branches: [development, main] paths: - - 'app/**' + - "app/**" # Allows you to run this workflow manually from the Actions tab workflow_dispatch: env: - APP_SRC_PATH: './app/defikarte/' # set this to the path to your web app project, defaults to the repository root + APP_SRC_PATH: "./app/defikarte/" # set this to the path to your web app project, defaults to the repository root RELEASE_PROFILE: "${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}" REACT_NATIVE_BASE_URL: "${{ github.ref == 'refs/heads/main' && 'https://defikarte-backend.azurewebsites.net/api' || 'https://defikarte-backend-staging.azurewebsites.net/api' }}" - REACT_NATIVE_GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} + REACT_NATIVE_GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API }} REACT_NATIVE_API_KEY: ${{ secrets.AZURE_FUNCTIONAPP_API_KEY }} jobs: @@ -32,7 +32,7 @@ jobs: expo-version: 6.x eas-version: latest token: ${{ secrets.EXPO_CLI_TOKEN }} - packager: 'npm' + packager: "npm" - name: Install dependencies working-directory: ${{ env.APP_SRC_PATH }} run: npm ci From 84c87585ecde9d4919f7af897420d9631ab73faa Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 17:41:18 +0100 Subject: [PATCH 5/9] Add new version --- app/defikarte/app.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/defikarte/app.json b/app/defikarte/app.json index 38516b8..731bbaf 100644 --- a/app/defikarte/app.json +++ b/app/defikarte/app.json @@ -3,7 +3,7 @@ "name": "Defikarte.ch", "slug": "Defikarte-ch", "owner": "defikarte", - "version": "1.0.24", + "version": "1.0.25", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", @@ -18,14 +18,14 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "ch.defikarte.app", - "buildNumber": "1.0.24", + "buildNumber": "1.0.25", "infoPlist": { "NSLocationWhenInUseUsageDescription": "Diese App benötigt die Standortdaten deines Gerätes um den nächsten Defi anzeigen zu können." } }, "android": { "package": "ch.defikarte.app", - "versionCode": 24, + "versionCode": 25, "permissions": [ "ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION" From dc54967a69a934991b8cbca37245ec0f4f5b8a70 Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 21:40:11 +0100 Subject: [PATCH 6/9] Fix maps version, api key was the problem --- app/defikarte/package-lock.json | 2 +- app/defikarte/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/defikarte/package-lock.json b/app/defikarte/package-lock.json index 10b2526..a543fd2 100644 --- a/app/defikarte/package-lock.json +++ b/app/defikarte/package-lock.json @@ -30,7 +30,7 @@ "react-native": "0.72.5", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "^1.8.0", + "react-native-maps": "^1.7.1", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", diff --git a/app/defikarte/package.json b/app/defikarte/package.json index ca929bf..3be5360 100644 --- a/app/defikarte/package.json +++ b/app/defikarte/package.json @@ -31,7 +31,7 @@ "react-native": "0.72.5", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "^1.8.0", + "react-native-maps": "^1.7.1", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", From ee77dc80a7c76a5611a60c05ca12def129837f05 Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 1 Nov 2023 21:40:39 +0100 Subject: [PATCH 7/9] Increment version by 1 --- app/defikarte/app.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/defikarte/app.json b/app/defikarte/app.json index 731bbaf..8d51032 100644 --- a/app/defikarte/app.json +++ b/app/defikarte/app.json @@ -3,7 +3,7 @@ "name": "Defikarte.ch", "slug": "Defikarte-ch", "owner": "defikarte", - "version": "1.0.25", + "version": "1.0.26", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", @@ -18,14 +18,14 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "ch.defikarte.app", - "buildNumber": "1.0.25", + "buildNumber": "1.0.26", "infoPlist": { "NSLocationWhenInUseUsageDescription": "Diese App benötigt die Standortdaten deines Gerätes um den nächsten Defi anzeigen zu können." } }, "android": { "package": "ch.defikarte.app", - "versionCode": 25, + "versionCode": 26, "permissions": [ "ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION" From 474339231d1e61787da10fa9774261b27d3d5b1a Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 15 Nov 2023 08:34:16 +0100 Subject: [PATCH 8/9] Fix dependencies to location and maps --- app/defikarte/package-lock.json | 42 ++++++++++++++++----------------- app/defikarte/package.json | 6 ++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/defikarte/package-lock.json b/app/defikarte/package-lock.json index a543fd2..944bee5 100644 --- a/app/defikarte/package-lock.json +++ b/app/defikarte/package-lock.json @@ -14,7 +14,7 @@ "dotenv": "^16.3.1", "eas": "^0.1.0", "expo": "~49.0.13", - "expo-dev-client": "~2.4.11", + "expo-dev-client": "~2.4.12", "expo-localization": "~14.3.0", "expo-location": "~16.1.0", "expo-splash-screen": "~0.20.5", @@ -27,10 +27,10 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.47.0", - "react-native": "0.72.5", + "react-native": "0.72.6", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "^1.7.1", + "react-native-maps": "1.7.1", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", @@ -7761,12 +7761,12 @@ } }, "node_modules/expo-dev-client": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.4.11.tgz", - "integrity": "sha512-A7aKQZeEYG0YJ51GnjOFkMNe118jD1cbU+v5iM3E+H1Co5aVtnlGZWcv8Dtw3uGuWxRgbWGds5TGNbcDmJ1hDg==", + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.4.12.tgz", + "integrity": "sha512-3+xg0yb/0g6+JQaWq5+xn2uHoOXP4oSX33aWkaZPSNJLoyzfRaHNDF5MLcrMBbEHCw5T5qZRU291K+uQeMMC0g==", "dependencies": { - "expo-dev-launcher": "2.4.13", - "expo-dev-menu": "3.2.1", + "expo-dev-launcher": "2.4.14", + "expo-dev-menu": "3.2.2", "expo-dev-menu-interface": "1.3.0", "expo-manifests": "~0.7.0", "expo-updates-interface": "~0.10.0" @@ -7776,11 +7776,11 @@ } }, "node_modules/expo-dev-launcher": { - "version": "2.4.13", - "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.4.13.tgz", - "integrity": "sha512-afszaREyGnhWJMmcOuDGs83r0UWeRvZrOHlKQxxst/UhAeFQqlDmkEjwtDWfTUy7BoXuuw2CuQtUFH+vTyjEGA==", + "version": "2.4.14", + "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.4.14.tgz", + "integrity": "sha512-SlUf+fEX9sKzDzY1Ui8j5775eLKpO0xPVoI89G7CRsrpUv6ZRvRF836cMFesxkU5d+3bXHpKzDQiEPDSI1G/WQ==", "dependencies": { - "expo-dev-menu": "3.2.1", + "expo-dev-menu": "3.2.2", "resolve-from": "^5.0.0", "semver": "^7.5.3" }, @@ -7819,9 +7819,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/expo-dev-menu": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-3.2.1.tgz", - "integrity": "sha512-SxH/ZUIYZliMBjJTpiECVSDkP7e81mbGNLH8ZD69iCAfLeH7P1OPXFycEdcvN33I7tVqzFgARGLK/W/8JV+U9w==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-3.2.2.tgz", + "integrity": "sha512-q0IDlCGkZMsDIFV+Mgnz0Q3u/bcnrF8IFMglJ0onF09e5csLk5Ts7hKoQyervOJeThyI402r9OQsFNaru2tgtg==", "dependencies": { "expo-dev-menu-interface": "1.3.0", "semver": "^7.5.3" @@ -12396,9 +12396,9 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-native": { - "version": "0.72.5", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.5.tgz", - "integrity": "sha512-oIewslu5DBwOmo7x5rdzZlZXCqDIna0R4dUwVpfmVteORYLr4yaZo5wQnMeR+H7x54GaMhmgeqp0ZpULtulJFg==", + "version": "0.72.6", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.6.tgz", + "integrity": "sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==", "dependencies": { "@jest/create-cache-key-function": "^29.2.1", "@react-native-community/cli": "11.3.7", @@ -12485,9 +12485,9 @@ } }, "node_modules/react-native-maps": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.8.0.tgz", - "integrity": "sha512-KfVZ03L42+a22Fkcl2uDe5d+73BweTlcRUzm2G+aQUJ7fHrBxj7CuXWtKMSNpVDiO3YDCWcshiiyjSXxkd/qOw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-1.7.1.tgz", + "integrity": "sha512-CHVLzL+Q2jiUGgbt4/vosxVI1SukWyaLGjD62VLgR/wZpnH4Umi9ql1bmKDPWcfj2C1QZwMU0Yc7rXTbvZUIiw==", "dependencies": { "@types/geojson": "^7946.0.10" }, diff --git a/app/defikarte/package.json b/app/defikarte/package.json index 3be5360..e6d042e 100644 --- a/app/defikarte/package.json +++ b/app/defikarte/package.json @@ -15,7 +15,7 @@ "dotenv": "^16.3.1", "eas": "^0.1.0", "expo": "~49.0.13", - "expo-dev-client": "~2.4.11", + "expo-dev-client": "~2.4.12", "expo-localization": "~14.3.0", "expo-location": "~16.1.0", "expo-splash-screen": "~0.20.5", @@ -28,10 +28,10 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^7.47.0", - "react-native": "0.72.5", + "react-native": "0.72.6", "react-native-gesture-handler": "~2.12.0", "react-native-map-clustering": "^3.4.2", - "react-native-maps": "^1.7.1", + "react-native-maps": "1.7.1", "react-native-open-maps": "^0.4.3", "react-native-reanimated": "~3.3.0", "react-native-safe-area-context": "4.6.3", From 639008e88dc5de9917167caf74160e6e2cc905e6 Mon Sep 17 00:00:00 2001 From: Marc Muehlheim Date: Wed, 15 Nov 2023 08:56:36 +0100 Subject: [PATCH 9/9] Update position only every 20s --- app/defikarte/src/hooks/useLocation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/defikarte/src/hooks/useLocation.js b/app/defikarte/src/hooks/useLocation.js index 07887df..4e2729b 100644 --- a/app/defikarte/src/hooks/useLocation.js +++ b/app/defikarte/src/hooks/useLocation.js @@ -18,7 +18,7 @@ export default (userLocation, callback, enableLocationTracking, setLocationTrack const sub = await watchPositionAsync( { accuracy: Accuracy.BestForNavigation, - timeInterval: 2000, + timeInterval: 20000, distanceInterval: 10, }, callback