mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 01:11:20 +03:00
feat(web): show partners assets on the main timeline (#4933)
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
|
||||
export interface AssetControlContext {
|
||||
// Wrap assets in a function, because context isn't reactive.
|
||||
getAssets: () => Set<AssetResponseDto>;
|
||||
getAssets: () => Set<AssetResponseDto>; // All assets includes partners' assets
|
||||
getOwnedAssets: () => Set<AssetResponseDto>; // Only assets owned by the user
|
||||
clearSelect: () => void;
|
||||
}
|
||||
|
||||
@@ -25,8 +26,14 @@
|
||||
|
||||
export let assets: Set<AssetResponseDto>;
|
||||
export let clearSelect: () => void;
|
||||
export let ownerId: string | undefined = undefined;
|
||||
|
||||
setContext({ getAssets: () => assets, clearSelect });
|
||||
setContext({
|
||||
getAssets: () => assets,
|
||||
getOwnedAssets: () =>
|
||||
ownerId !== undefined ? new Set(Array.from(assets).filter((asset) => asset.ownerId === ownerId)) : assets,
|
||||
clearSelect,
|
||||
});
|
||||
</script>
|
||||
|
||||
<ControlAppBar on:close-button-click={clearSelect} backIcon={mdiClose} tailwindClasses="bg-white shadow-md">
|
||||
|
||||
Reference in New Issue
Block a user