mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix(web): removing a person in an asset, doesn't remove the asset in … (#26068)
* fix(web): removing a person in an asset, doesn't remove the asset in the persons view (without refresh) * prettier --------- Co-authored-by: Nikos Verschore <nikos@uwsoftware.be>
This commit is contained in:
parent
57485023ae
commit
5f18110e97
3 changed files with 18 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import OnEvents from '$lib/components/OnEvents.svelte';
|
import OnEvents from '$lib/components/OnEvents.svelte';
|
||||||
import { timeBeforeShowLoadingSpinner } from '$lib/constants';
|
import { timeBeforeShowLoadingSpinner } from '$lib/constants';
|
||||||
|
import { eventManager } from '$lib/managers/event-manager.svelte';
|
||||||
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
||||||
import { boundingBoxesArray } from '$lib/stores/people.store';
|
import { boundingBoxesArray } from '$lib/stores/people.store';
|
||||||
import { getPeopleThumbnailUrl, handlePromiseError } from '$lib/utils';
|
import { getPeopleThumbnailUrl, handlePromiseError } from '$lib/utils';
|
||||||
|
|
@ -174,6 +175,8 @@
|
||||||
|
|
||||||
await deleteFace({ id: face.id, assetFaceDeleteDto: { force: false } });
|
await deleteFace({ id: face.id, assetFaceDeleteDto: { force: false } });
|
||||||
|
|
||||||
|
eventManager.emit('PersonAssetDelete', { id: face.person.id, assetId });
|
||||||
|
|
||||||
peopleWithFaces = peopleWithFaces.filter((f) => f.id !== face.id);
|
peopleWithFaces = peopleWithFaces.filter((f) => f.id !== face.id);
|
||||||
|
|
||||||
await assetViewingStore.setAssetId(assetId);
|
await assetViewingStore.setAssetId(assetId);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ export type Events = {
|
||||||
|
|
||||||
PersonUpdate: [PersonResponseDto];
|
PersonUpdate: [PersonResponseDto];
|
||||||
PersonThumbnailReady: [{ id: string }];
|
PersonThumbnailReady: [{ id: string }];
|
||||||
|
PersonAssetDelete: [{ id: string; assetId: string }];
|
||||||
|
|
||||||
BackupDeleteStatus: [{ filename: string; isDeleting: boolean }];
|
BackupDeleteStatus: [{ filename: string; isDeleting: boolean }];
|
||||||
BackupDeleted: [{ filename: string }];
|
BackupDeleted: [{ filename: string }];
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,14 @@
|
||||||
person = response;
|
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 { SetDateOfBirth, Favorite, Unfavorite, HidePerson, ShowPerson } = $derived(getPersonActions($t, person));
|
||||||
const SelectFeaturePhoto: ActionItem = {
|
const SelectFeaturePhoto: ActionItem = {
|
||||||
title: $t('select_featured_photo'),
|
title: $t('select_featured_photo'),
|
||||||
|
|
@ -315,7 +323,12 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<OnEvents {onPersonUpdate} onAssetsDelete={updateAssetCount} onAssetsArchive={updateAssetCount} />
|
<OnEvents
|
||||||
|
{onPersonUpdate}
|
||||||
|
onPersonAssetDelete={handlePersonAssetDelete}
|
||||||
|
onAssetsDelete={updateAssetCount}
|
||||||
|
onAssetsArchive={updateAssetCount}
|
||||||
|
/>
|
||||||
|
|
||||||
<main
|
<main
|
||||||
class="relative z-0 h-dvh overflow-hidden px-2 md:px-6 md:pt-(--navbar-height-md) pt-(--navbar-height)"
|
class="relative z-0 h-dvh overflow-hidden px-2 md:px-6 md:pt-(--navbar-height-md) pt-(--navbar-height)"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue