1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-24 15:29:36 +02:00

Update nginx migration documentation and enhance AdventureModal component functionality

This commit is contained in:
Sean Morley 2024-11-08 17:15:53 -05:00
parent efd19da10b
commit 6132b1c0d6
2 changed files with 9 additions and 15 deletions

View file

@ -16,7 +16,7 @@ You can also just use the new `docker-compose.yml` file in the repository and ch
1. Remove the `nginx` service from your `docker-compose.yml` file.
2. Update the `PUBLIC_URL` environment variable in the `server` service (backend) to match the address of your **server**, instead of the previous nginx instance. For example, if your server is exposed to `https://localhost:8000`, set `PUBLIC_URL` to `http://localhost:8000`. If you are using a domain name, set `PUBLIC_URL` to `https://api.yourdomain.com` as an example.
3. Change port mapping for the `server` service. Right now it probally looks like this:
3. Change port mapping for the `server` service. Right now it probably looks like this:
```yaml
ports:
- "your-exposed-port:8000"

View file

@ -17,7 +17,7 @@
export let latitude: number | null = null;
export let collection: Collection | null = null;
import { DefaultMarker, MapEvents, MapLibre } from 'svelte-maplibre';
import { DefaultMarker, FillLayer, MapEvents, MapLibre } from 'svelte-maplibre';
let query: string = '';
let places: OpenStreetMapPlace[] = [];
@ -89,7 +89,7 @@
if (longitude && latitude) {
adventure.latitude = latitude;
adventure.longitude = longitude;
reverseGeocode();
reverseGeocode(true);
}
$: {
@ -120,16 +120,6 @@
markers = [];
}
// $: {
// if (
// reverseGeocodePlace?.display_name &&
// (old_display_name != reverseGeocodePlace.display_name || !adventure.location)
// ) {
// adventure.location = reverseGeocodePlace.display_name;
// old_display_name = reverseGeocodePlace.display_name;
// }
// }
let imageSearch: string = adventure.name || '';
async function removeImage(id: string) {
@ -298,7 +288,7 @@
}
}
async function reverseGeocode() {
async function reverseGeocode(force_update: boolean = false) {
let res = await fetch(
`/api/reverse-geocode/reverse_geocode/?lat=${adventure.latitude}&lon=${adventure.longitude}`
);
@ -310,7 +300,11 @@
}
reverseGeocodePlace = data;
if (reverseGeocodePlace && reverseGeocodePlace.display_name && !is_custom_location) {
if (
reverseGeocodePlace &&
reverseGeocodePlace.display_name &&
(!is_custom_location || force_update)
) {
old_display_name = reverseGeocodePlace.display_name;
adventure.location = reverseGeocodePlace.display_name;
}