mirror of
https://github.com/immich-app/immich.git
synced 2025-12-28 17:24:56 +03:00
feat(web): allow hiding all unnamed faces and reset hidden faces (#9378)
* feat: hide all unnamed * feat: remove dispatch event * pr feedback
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import MergeSuggestionModal from '$lib/components/faces-page/merge-suggestion-modal.svelte';
|
||||
import PeopleCard from '$lib/components/faces-page/people-card.svelte';
|
||||
import SetBirthDateModal from '$lib/components/faces-page/set-birth-date-modal.svelte';
|
||||
import ShowHide from '$lib/components/faces-page/show-hide.svelte';
|
||||
import ShowHide, { ToggleVisibilty } from '$lib/components/faces-page/show-hide.svelte';
|
||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
|
||||
import {
|
||||
@@ -48,7 +48,7 @@
|
||||
let searchName = '';
|
||||
|
||||
let showLoadingSpinner = false;
|
||||
let toggleVisibility = false;
|
||||
let toggleVisibility: ToggleVisibilty = ToggleVisibilty.VIEW_ALL;
|
||||
|
||||
let showChangeNameModal = false;
|
||||
let showSetBirthDateModal = false;
|
||||
@@ -104,7 +104,7 @@
|
||||
// Reset variables used on the "Show & hide people" modal
|
||||
showLoadingSpinner = false;
|
||||
selectHidden = false;
|
||||
toggleVisibility = false;
|
||||
toggleVisibility = ToggleVisibilty.VIEW_ALL;
|
||||
};
|
||||
|
||||
const handleResetVisibility = () => {
|
||||
@@ -116,10 +116,17 @@
|
||||
people = people;
|
||||
};
|
||||
|
||||
const handleToggleVisibility = () => {
|
||||
toggleVisibility = !toggleVisibility;
|
||||
const handleToggleVisibility = (toggleVisibility: ToggleVisibilty) => {
|
||||
for (const person of people) {
|
||||
person.isHidden = toggleVisibility;
|
||||
if (toggleVisibility == ToggleVisibilty.HIDE_ALL) {
|
||||
person.isHidden = true;
|
||||
}
|
||||
if (toggleVisibility == ToggleVisibilty.VIEW_ALL) {
|
||||
person.isHidden = false;
|
||||
}
|
||||
if (toggleVisibility == ToggleVisibilty.HIDE_UNNANEMD && !person.name) {
|
||||
person.isHidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
// trigger reactivity
|
||||
@@ -172,7 +179,7 @@
|
||||
// Reset variables used on the "Show & hide people" modal
|
||||
showLoadingSpinner = false;
|
||||
selectHidden = false;
|
||||
toggleVisibility = false;
|
||||
toggleVisibility = ToggleVisibilty.VIEW_ALL;
|
||||
};
|
||||
|
||||
const handleMergeSamePerson = async (response: [PersonResponseDto, PersonResponseDto]) => {
|
||||
@@ -483,10 +490,10 @@
|
||||
</UserPageLayout>
|
||||
{#if selectHidden}
|
||||
<ShowHide
|
||||
on:done={handleDoneClick}
|
||||
on:close={handleCloseClick}
|
||||
on:reset={handleResetVisibility}
|
||||
on:change={handleToggleVisibility}
|
||||
onDone={handleDoneClick}
|
||||
onClose={handleCloseClick}
|
||||
onReset={handleResetVisibility}
|
||||
onChange={handleToggleVisibility}
|
||||
bind:showLoadingSpinner
|
||||
bind:toggleVisibility
|
||||
{countTotalPeople}
|
||||
|
||||
Reference in New Issue
Block a user