all repos — caroster @ af77ff038286cd2975dbaf3140a13a1adc198379

[Octree] Group carpool to your event https://caroster.io

fix: 🐛 Fix share feature

* fix: 🌐 missing locale

* chore: 🔊 Add logs

* fix: ✏️ typo

* fix: 🩹 share button doesn't work in next build
Simon Mulquin simon@octree.ch
Thu, 16 Mar 2023 09:20:11 +0100
commit

af77ff038286cd2975dbaf3140a13a1adc198379

parent

d453f1ded22e07a77357c43c71b7fde95ce233ef

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M frontend/containers/Languages/MenuItem.tsxfrontend/containers/Languages/MenuItem.tsx

@@ -42,7 +42,7 @@ {Object.keys(SupportedLocales).map(locale => (

<MenuItem disabled={language === SupportedLocales[locale]} onClick={() => onConfirm(SupportedLocales[locale])} - >{t(`languages.${locale}`)}</MenuItem> + >{t(`PROTECTED.languages.${locale}`)}</MenuItem> ))} </MenuList> </Box>
M frontend/hooks/useShare.tsfrontend/hooks/useShare.ts

@@ -22,8 +22,9 @@ const splittedUrl = url.split('/');

const localeParamIndex = splittedUrl.findIndex( member => SupportedLocales[member] ); - splittedUrl[localeParamIndex] = DEFAULT_LOCALE; - const withDefaultLocaleURL = splittedUrl.join('/'); + const urlCopy = [...splittedUrl] + urlCopy[localeParamIndex] = DEFAULT_LOCALE; + const withDefaultLocaleURL = urlCopy.join('/'); // If navigator share capability if (navigatorHasShareCapability) { return await navigator.share({