mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
feat: timeline performance (#16446)
* Squash - feature complete * remove need to init assetstore * More optimizations. No need to init. Fix tests * lint * add missing selector for e2e * e2e selectors again * Update: fully reactive store, some transitions, bugfixes * merge fallout * Test fallout * safari quirk * security * lint * lint * Bug fixes * lint/format * accidental commit * lock * null check, more throttle * revert long duration * Fix intersection bounds * Fix bugs in intersection calculation * lint, tweak scrubber ui a tiny bit * bugfix - deselecting asset doesnt work * fix not loading bucket, scroll off-by-1 error, jsdoc, naming
This commit is contained in:
@@ -5,8 +5,14 @@ import { fromStore } from 'svelte/store';
|
||||
|
||||
export class AssetInteraction {
|
||||
readonly selectedAssets = new SvelteSet<AssetResponseDto>();
|
||||
hasSelectedAsset(assetId: string) {
|
||||
return [...this.selectedAssets.values()].some((asset) => asset.id === assetId);
|
||||
}
|
||||
readonly selectedGroup = new SvelteSet<string>();
|
||||
assetSelectionCandidates = $state(new SvelteSet<AssetResponseDto>());
|
||||
hasSelectionCandidate(assetId: string) {
|
||||
return [...this.assetSelectionCandidates.values()].some((asset) => asset.id === assetId);
|
||||
}
|
||||
assetSelectionStart = $state<AssetResponseDto | null>(null);
|
||||
focussedAssetId = $state<string | null>(null);
|
||||
|
||||
@@ -32,7 +38,10 @@ export class AssetInteraction {
|
||||
}
|
||||
|
||||
removeAssetFromMultiselectGroup(asset: AssetResponseDto) {
|
||||
this.selectedAssets.delete(asset);
|
||||
const selectedAsset = [...this.selectedAssets.values()].find((a) => a.id === asset.id);
|
||||
if (selectedAsset) {
|
||||
this.selectedAssets.delete(selectedAsset);
|
||||
}
|
||||
}
|
||||
|
||||
addGroupToMultiselectGroup(group: string) {
|
||||
|
||||
Reference in New Issue
Block a user