Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web/src/lib/components/faces-page/person-side-panel.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import OnEvents from '$lib/components/OnEvents.svelte';
import { timeBeforeShowLoadingSpinner } from '$lib/constants';
import { eventManager } from '$lib/managers/event-manager.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { boundingBoxesArray } from '$lib/stores/people.store';
import { getPeopleThumbnailUrl, handlePromiseError } from '$lib/utils';
Expand Down Expand Up @@ -174,6 +175,8 @@

await deleteFace({ id: face.id, assetFaceDeleteDto: { force: false } });

eventManager.emit('PersonAssetDelete', { id: face.person.id, assetId });

peopleWithFaces = peopleWithFaces.filter((f) => f.id !== face.id);

await assetViewingStore.setAssetId(assetId);
Expand Down
1 change: 1 addition & 0 deletions web/src/lib/managers/event-manager.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type Events = {

PersonUpdate: [PersonResponseDto];
PersonThumbnailReady: [{ id: string }];
PersonAssetDelete: [{ id: string; assetId: string }];

BackupDeleteStatus: [{ filename: string; isDeleting: boolean }];
BackupDeleted: [{ filename: string }];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@
person = response;
};

const handlePersonAssetDelete = async ({ id, assetId }: { id: string; assetId: string }) => {
if (id !== person.id) {
return;
}
timelineManager.removeAssets([assetId]);
await updateAssetCount();
};

const { SetDateOfBirth, Favorite, Unfavorite, HidePerson, ShowPerson } = $derived(getPersonActions($t, person));
const SelectFeaturePhoto: ActionItem = {
title: $t('select_featured_photo'),
Expand All @@ -315,7 +323,12 @@
};
</script>

<OnEvents {onPersonUpdate} onAssetsDelete={updateAssetCount} onAssetsArchive={updateAssetCount} />
<OnEvents
{onPersonUpdate}
onPersonAssetDelete={handlePersonAssetDelete}
onAssetsDelete={updateAssetCount}
onAssetsArchive={updateAssetCount}
/>

<main
class="relative z-0 h-dvh overflow-hidden px-2 md:px-6 md:pt-(--navbar-height-md) pt-(--navbar-height)"
Expand Down
Loading