dd2c7400a6
* chore(web): another missing translations * unused removed * more keys * lint fix * test fixed * dynamic translation fix * fixes * people search translation * params fixed * keep filter setting fix * lint fix * $t fixes * Update web/src/lib/i18n/en.json Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * another missing * activity translation * link sharing translations * expiration dropdown fix - didn't work localized * notification title * device logout * search results * reset to default * unsaved change * select from computer * selected * select-2 * select-3 * unmerge * pluralize, force icu message * Update web/src/lib/components/asset-viewer/asset-viewer.svelte Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * review fixes * remove user * plural fixes * ffmpeg settings * fixes * error title * plural fixes * onboarding * change password * more more * console log fix * another * api key desc * map marker * format fix * key fix * asset-utils * utils * misc --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
39 lines
1.4 KiB
Svelte
39 lines
1.4 KiB
Svelte
<script lang="ts" context="module">
|
|
import { createContext } from '$lib/utils/context';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
export interface AssetControlContext {
|
|
// Wrap assets in a function, because context isn't reactive.
|
|
getAssets: () => Set<AssetResponseDto>; // All assets includes partners' assets
|
|
getOwnedAssets: () => Set<AssetResponseDto>; // Only assets owned by the user
|
|
clearSelect: () => void;
|
|
}
|
|
|
|
const { get: getAssetControlContext, set: setContext } = createContext<AssetControlContext>();
|
|
export { getAssetControlContext };
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import type { AssetResponseDto } from '@immich/sdk';
|
|
import { mdiClose } from '@mdi/js';
|
|
import ControlAppBar from '../shared-components/control-app-bar.svelte';
|
|
|
|
export let assets: Set<AssetResponseDto>;
|
|
export let clearSelect: () => void;
|
|
export let ownerId: string | undefined = undefined;
|
|
|
|
setContext({
|
|
getAssets: () => assets,
|
|
getOwnedAssets: () =>
|
|
ownerId === undefined ? assets : new Set([...assets].filter((asset) => asset.ownerId === ownerId)),
|
|
clearSelect,
|
|
});
|
|
</script>
|
|
|
|
<ControlAppBar on:close={clearSelect} backIcon={mdiClose} tailwindClasses="bg-white shadow-md">
|
|
<p class="font-medium text-immich-primary dark:text-immich-dark-primary" slot="leading">
|
|
{$t('selected_count', { values: { count: assets.size } })}
|
|
</p>
|
|
<slot slot="trailing" />
|
|
</ControlAppBar>
|