fix(web): dynamically import wasm module (#16261)

* dynamically import wasm module

* remove unused import
This commit is contained in:
Mert 2025-02-22 21:16:06 +03:00 committed by GitHub
parent e4b6efc1f5
commit 4376fd72b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 77 deletions

View file

@ -1,6 +1,6 @@
import type { AssetBucket } from '$lib/stores/assets.store';
import { locale } from '$lib/stores/preferences.store';
import { JustifiedLayout } from '@immich/justified-layout-wasm';
import type { JustifiedLayout } from '@immich/justified-layout-wasm';
import type { AssetResponseDto } from '@immich/sdk';
import { groupBy, memoize, sortBy } from 'lodash-es';
import { DateTime } from 'luxon';
@ -13,7 +13,7 @@ export type DateGroup = {
height: number;
heightActual: boolean;
intersecting: boolean;
geometry: JustifiedLayout;
geometry: JustifiedLayout | null;
bucket: AssetBucket;
};
export type ScrubberListener = (
@ -80,13 +80,6 @@ export function formatGroupTitle(_date: DateTime): string {
return date.toLocaleString(groupDateFormat);
}
const emptyGeometry = new JustifiedLayout(Float32Array.from([]), {
rowHeight: 1,
heightTolerance: 0,
rowWidth: 1,
spacing: 0,
});
const formatDateGroupTitle = memoize(formatGroupTitle);
export function splitBucketIntoDateGroups(bucket: AssetBucket, locale: string | undefined): DateGroup[] {
@ -104,7 +97,7 @@ export function splitBucketIntoDateGroups(bucket: AssetBucket, locale: string |
height: 0,
heightActual: false,
intersecting: false,
geometry: emptyGeometry,
geometry: null,
bucket,
};
});