mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: navigate to time (#22078)
This commit is contained in:
parent
1d6b98ff86
commit
8821c251c3
1 changed files with 9 additions and 6 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
setFocusTo as setFocusToInit,
|
setFocusTo as setFocusToInit,
|
||||||
} from '$lib/components/photos-page/actions/focus-actions';
|
} from '$lib/components/photos-page/actions/focus-actions';
|
||||||
import Skeleton from '$lib/components/photos-page/skeleton.svelte';
|
import Skeleton from '$lib/components/photos-page/skeleton.svelte';
|
||||||
|
import type { AbsoluteResult, RelativeResult } from '$lib/components/shared-components/change-date.svelte';
|
||||||
import ChangeDate from '$lib/components/shared-components/change-date.svelte';
|
import ChangeDate from '$lib/components/shared-components/change-date.svelte';
|
||||||
import Scrubber from '$lib/components/shared-components/scrubber/scrubber.svelte';
|
import Scrubber from '$lib/components/shared-components/scrubber/scrubber.svelte';
|
||||||
import { AppRoute, AssetAction } from '$lib/constants';
|
import { AppRoute, AssetAction } from '$lib/constants';
|
||||||
|
|
@ -845,13 +846,15 @@
|
||||||
title="Navigate to Time"
|
title="Navigate to Time"
|
||||||
initialDate={DateTime.now()}
|
initialDate={DateTime.now()}
|
||||||
timezoneInput={false}
|
timezoneInput={false}
|
||||||
onConfirm={async (dateString: string) => {
|
onConfirm={async (dateString: AbsoluteResult | RelativeResult) => {
|
||||||
isShowSelectDate = false;
|
isShowSelectDate = false;
|
||||||
const asset = await timelineManager.getClosestAssetToDate(
|
if (dateString.mode == 'absolute') {
|
||||||
(DateTime.fromISO(dateString) as DateTime<true>).toObject(),
|
const asset = await timelineManager.getClosestAssetToDate(
|
||||||
);
|
(DateTime.fromISO(dateString.date) as DateTime<true>).toObject(),
|
||||||
if (asset) {
|
);
|
||||||
setFocusAsset(asset);
|
if (asset) {
|
||||||
|
setFocusAsset(asset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onCancel={() => (isShowSelectDate = false)}
|
onCancel={() => (isShowSelectDate = false)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue