mirror of
https://github.com/immich-app/immich.git
synced 2026-06-12 19:11:52 -07:00
feat(web): warn before overwriting existing locations in geolocation utility (#28840)
This commit is contained in:
@@ -2248,6 +2248,7 @@
|
|||||||
"slideshow_repeat_description": "Loop back to beginning when slideshow ends",
|
"slideshow_repeat_description": "Loop back to beginning when slideshow ends",
|
||||||
"slideshow_settings": "Slideshow settings",
|
"slideshow_settings": "Slideshow settings",
|
||||||
"smart_album": "Smart album",
|
"smart_album": "Smart album",
|
||||||
|
"some_assets_already_have_a_location_warning": "Some of the selected assets already have a location",
|
||||||
"sort_albums_by": "Sort albums by...",
|
"sort_albums_by": "Sort albums by...",
|
||||||
"sort_created": "Date created",
|
"sort_created": "Date created",
|
||||||
"sort_items": "Number of items",
|
"sort_items": "Number of items",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { assetMultiSelectManager } from '$lib/managers/asset-multi-select-manager.svelte';
|
||||||
import type { LatLng } from '$lib/types';
|
import type { LatLng } from '$lib/types';
|
||||||
import { ConfirmModal } from '@immich/ui';
|
import { Alert, ConfirmModal } from '@immich/ui';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -9,11 +10,18 @@
|
|||||||
onClose: (confirm: boolean) => void;
|
onClose: (confirm: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
let { point, assetCount, onClose }: Props = $props();
|
const { point, assetCount, onClose }: Props = $props();
|
||||||
|
|
||||||
|
const hasExistingLocations = $derived(
|
||||||
|
assetMultiSelectManager.assets.some((asset) => asset.latitude != null || asset.longitude != null),
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ConfirmModal title={$t('confirm')} size="small" confirmColor="primary" {onClose}>
|
<ConfirmModal title={$t('confirm')} size="small" confirmColor="primary" {onClose}>
|
||||||
{#snippet prompt()}
|
{#snippet prompt()}
|
||||||
|
{#if hasExistingLocations}
|
||||||
|
<Alert color="warning" class="mb-4">{$t('some_assets_already_have_a_location_warning')}</Alert>
|
||||||
|
{/if}
|
||||||
<p>{$t('update_location_action_prompt', { values: { count: assetCount } })}</p>
|
<p>{$t('update_location_action_prompt', { values: { count: assetCount } })}</p>
|
||||||
<p>- {$t('latitude')}: {point.lat}</p>
|
<p>- {$t('latitude')}: {point.lat}</p>
|
||||||
<p>- {$t('longitude')}: {point.lng}</p>
|
<p>- {$t('longitude')}: {point.lng}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user