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

Refactor geocoding and integration handling: remove debug print, streamline reverse geocoding logic, and enhance integration response structure

This commit is contained in:
Sean Morley 2025-05-25 22:13:18 -04:00
parent c123231bab
commit e56335d30f
16 changed files with 95 additions and 46 deletions

View file

@ -7,11 +7,19 @@
const dispatch = createEventDispatcher();
let modal: HTMLDialogElement;
onMount(() => {
let integrations: Record<string, boolean> | null = null;
onMount(async () => {
modal = document.getElementById('about_modal') as HTMLDialogElement;
if (modal) {
modal.showModal();
}
const response = await fetch('/api/integrations');
if (response.ok) {
integrations = await response.json();
} else {
integrations = null;
}
});
function close() {
@ -90,18 +98,38 @@
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">
{$t('about.oss_attributions')}
</h3>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
{$t('about.nominatim_1')}
<a
href="https://operations.osmfoundation.org/policies/nominatim/"
target="_blank"
rel="noopener noreferrer"
class="text-primary hover:underline"
>
OpenStreetMap
</a>
. {$t('about.nominatim_2')}
</p>
{#if integrations && integrations?.google_maps}
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
{$t('about.nominatim_1')}
<a
href="https://developers.google.com/maps/terms"
target="_blank"
rel="noopener noreferrer"
class="text-primary hover:underline"
>
Google Maps
</a>
.
</p>
{:else if integrations && !integrations?.google_maps}
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
{$t('about.nominatim_1')}
<a
href="https://operations.osmfoundation.org/policies/nominatim/"
target="_blank"
rel="noopener noreferrer"
class="text-primary hover:underline"
>
OpenStreetMap
</a>
. {$t('about.nominatim_2')}
</p>
{:else}
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
{$t('about.generic_attributions')}
</p>
{/if}
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">{$t('about.other_attributions')}</p>
</div>