Remove generics from AssetInteraction

This commit is contained in:
Min Idzelis
2025-04-20 03:47:51 +00:00
parent 9b7e9bc7b8
commit f3fe043c22
15 changed files with 43 additions and 45 deletions
@@ -38,7 +38,7 @@
import { numberOfComments, setNumberOfComments, updateNumberOfComments } from '$lib/stores/activity.store';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { SlideshowNavigation, SlideshowState, slideshowStore } from '$lib/stores/slideshow.store';
import { preferences, user } from '$lib/stores/user.store';
import { handlePromiseError } from '$lib/utils';
@@ -107,8 +107,8 @@
let reactions: ActivityResponseDto[] = $state([]);
let albumOrder: AssetOrder | undefined = $state(data.album.order);
const assetInteraction = new AssetInteraction<TimelineAsset>();
const timelineInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const timelineInteraction = new AssetInteraction();
afterNavigate(({ from }) => {
let url: string | undefined = from?.url?.pathname;
@@ -14,7 +14,7 @@
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
import { onDestroy } from 'svelte';
import { t } from 'svelte-i18n';
@@ -29,7 +29,7 @@
void assetStore.updateOptions({ isArchived: true });
onDestroy(() => assetStore.destroy());
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const handleEscape = () => {
if (assetInteraction.selectionActive) {
@@ -16,7 +16,7 @@
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import { AssetAction } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { preferences } from '$lib/stores/user.store';
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
import { onDestroy } from 'svelte';
@@ -33,7 +33,7 @@
void assetStore.updateOptions({ isFavorite: true, withStacked: true });
onDestroy(() => assetStore.destroy());
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const handleEscape = () => {
if (assetInteraction.selectionActive) {
@@ -9,7 +9,7 @@
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import { AppRoute } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { mdiArrowLeft, mdiPlus } from '@mdi/js';
import { onDestroy } from 'svelte';
import { t } from 'svelte-i18n';
@@ -24,7 +24,7 @@
const assetStore = new AssetStore();
$effect(() => void assetStore.updateOptions({ userId: data.partner.id, isArchived: false, withStacked: true }));
onDestroy(() => assetStore.destroy());
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const handleEscape = () => {
if (assetInteraction.selectionActive) {
@@ -71,7 +71,7 @@
$effect(() => void assetStore.updateOptions({ isArchived: false, personId: data.person.id }));
onDestroy(() => assetStore.destroy());
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
let viewMode: PersonPageViewMode = $state(PersonPageViewMode.VIEW_ASSETS);
let isEditingName = $state(false);
@@ -17,7 +17,7 @@
import TreeItems from '$lib/components/shared-components/tree/tree-items.svelte';
import { AppRoute, AssetAction, QueryParameter, SettingInputFieldType } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { buildTree, normalizeTreePath } from '$lib/utils/tree-utils';
import { deleteTag, getAllTags, updateTag, upsertTags, type TagResponseDto } from '@immich/sdk';
import { Button, HStack, Text } from '@immich/ui';
@@ -35,7 +35,7 @@
let pathSegments = $derived(data.path ? data.path.split('/') : []);
let currentPath = $derived($page.url.searchParams.get(QueryParameter.PATH) || '');
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const buildMap = (tags: TagResponseDto[]) => {
return Object.fromEntries(tags.map((tag) => [tag.value, tag]));
@@ -15,7 +15,7 @@
} from '$lib/components/shared-components/notification/notification';
import { AppRoute } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore, type TimelineAsset } from '$lib/stores/assets-store.svelte';
import { AssetStore } from '$lib/stores/assets-store.svelte';
import { featureFlags, serverConfig } from '$lib/stores/server-config.store';
import { handlePromiseError } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error';
@@ -40,7 +40,7 @@
void assetStore.updateOptions({ isTrashed: true });
onDestroy(() => assetStore.destroy());
const assetInteraction = new AssetInteraction<TimelineAsset>();
const assetInteraction = new AssetInteraction();
const handleEmptyTrash = async () => {
const isConfirmed = await dialogController.show({