Skip to content

High performance self-hosted photo and video management solution.

fix: navigate to time (#22078)

Alex8821c251c389
diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte
index c40aa7fe74..0142b823fa 100644
--- a/web/src/lib/components/photos-page/asset-grid.svelte
+++ b/web/src/lib/components/photos-page/asset-grid.svelte
@@ -9,6 +9,7 @@
setFocusTo as setFocusToInit,
} from '$lib/components/photos-page/actions/focus-actions';
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 Scrubber from '$lib/components/shared-components/scrubber/scrubber.svelte';
import { AppRoute, AssetAction } from '$lib/constants';
@@ -845,13 +846,15 @@
title="Navigate to Time"
initialDate={DateTime.now()}
timezoneInput={false}
- onConfirm={async (dateString: string) => {
+ onConfirm={async (dateString: AbsoluteResult | RelativeResult) => {
isShowSelectDate = false;
- const asset = await timelineManager.getClosestAssetToDate(
- (DateTime.fromISO(dateString) as DateTime<true>).toObject(),
- );
- if (asset) {
- setFocusAsset(asset);
+ if (dateString.mode == 'absolute') {
+ const asset = await timelineManager.getClosestAssetToDate(
+ (DateTime.fromISO(dateString.date) as DateTime<true>).toObject(),
+ );
+ if (asset) {
+ setFocusAsset(asset);
+ }
}
}}
onCancel={() => (isShowSelectDate = false)}