diff --git a/public/locales/de/common.json b/public/locales/de/common.json index a4e2fcba..84e012f5 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -19,8 +19,6 @@ "meters per second": "Meter pro Sekunde", "beaufort": "Beaufort", - "my city": "Meine Stadt", - "share text": "Checke doch mal diese Seite aus: ", "title 404 page": "404: Seite nicht gefunden", diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 809618c7..d95854ea 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -19,8 +19,6 @@ "meters per second": "Meters per second", "beaufort": "Beaufort", - "my city": "My city", - "share text": "Check out this page: ", "title 404 page": "404: This page could not be found", diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 779b5867..b64cea1f 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -280,12 +280,7 @@ const InternalHome = observer(() => {

- {activeCity$.name.get() === "My city" || - activeCity$.name.get() === "Meine Stadt" ? ( - <>{translationCommon("my city")} - ) : ( - <>{activeCity$.name.get()} - )} + {activeCity$.name.get()}

{temperature ? temperature : } diff --git a/src/pages/locationsettings/index.tsx b/src/pages/locationsettings/index.tsx index ce87ba83..f21e8a85 100644 --- a/src/pages/locationsettings/index.tsx +++ b/src/pages/locationsettings/index.tsx @@ -129,9 +129,15 @@ const LocationSettings = observer(() => { } if (city) { + const existingCity = addedCities$ + .get() + .find((value: ICity) => value.name === city!.name); if (addedCities$.get().find((value: ICity) => value.id === city!.id)) { activeCity$.set(city); toast.success(translationLocationSettings("switched to city toast")); + } else if (existingCity) { + activeCity$.set(existingCity); + toast.success(translationLocationSettings("switched to city toast")); } else { addedCities$.push(city); activeCity$.set(city); diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx index 28e81aab..8cfce44a 100644 --- a/src/pages/search/index.tsx +++ b/src/pages/search/index.tsx @@ -124,9 +124,15 @@ const Search = () => { } if (city) { + const existingCity = addedCities$ + .get() + .find((value: ICity) => value.name === city!.name); if (addedCities$.get().find((value: ICity) => value.id === city!.id)) { activeCity$.set(city); void router.push("/home"); + } else if (existingCity) { + activeCity$.set(existingCity); + void router.push("/home"); } else { addedCities$.push(city); activeCity$.set(city);