mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(web): cannot view publlic shared album (#3829)
This commit is contained in:
parent
d7f52739e8
commit
3b11be2859
@ -27,7 +27,6 @@
|
||||
export let assetInteractionStore: AssetInteractionStore;
|
||||
|
||||
const { selectedGroup, selectedAssets, assetSelectionCandidates, isMultiSelectState } = assetInteractionStore;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
select: { title: string; assets: AssetResponseDto[] };
|
||||
selectAssets: AssetResponseDto;
|
||||
@ -97,7 +96,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
assetViewingStore.setAssetId(asset.id);
|
||||
assetViewingStore.setAssetId(asset.id, publicSharedKey);
|
||||
};
|
||||
|
||||
const handleSelectGroup = (title: string, assets: AssetResponseDto[]) => dispatch('select', { title, assets });
|
||||
|
@ -24,7 +24,6 @@
|
||||
export let assetInteractionStore: AssetInteractionStore;
|
||||
export let removeAction: AssetAction | null = null;
|
||||
export let publicSharedKey: string | undefined = undefined;
|
||||
|
||||
const { assetSelectionCandidates, assetSelectionStart, selectedGroup, selectedAssets, isMultiSelectState } =
|
||||
assetInteractionStore;
|
||||
const viewport: Viewport = { width: 0, height: 0 };
|
||||
@ -98,7 +97,7 @@
|
||||
const handlePrevious = async () => {
|
||||
const previousAsset = await assetStore.getPreviousAssetId($viewingAsset.id);
|
||||
if (previousAsset) {
|
||||
assetViewingStore.setAssetId(previousAsset);
|
||||
assetViewingStore.setAssetId(previousAsset, publicSharedKey);
|
||||
}
|
||||
|
||||
return !!previousAsset;
|
||||
@ -107,7 +106,7 @@
|
||||
const handleNext = async () => {
|
||||
const nextAsset = await assetStore.getNextAssetId($viewingAsset.id);
|
||||
if (nextAsset) {
|
||||
assetViewingStore.setAssetId(nextAsset);
|
||||
assetViewingStore.setAssetId(nextAsset, publicSharedKey);
|
||||
}
|
||||
|
||||
return !!nextAsset;
|
||||
@ -372,6 +371,7 @@
|
||||
on:unarchived={({ detail: asset }) => handleAction(asset, AssetAction.UNARCHIVE)}
|
||||
on:favorite={({ detail: asset }) => handleAction(asset, AssetAction.FAVORITE)}
|
||||
on:unfavorite={({ detail: asset }) => handleAction(asset, AssetAction.UNFAVORITE)}
|
||||
{publicSharedKey}
|
||||
/>
|
||||
{/if}
|
||||
</Portal>
|
||||
|
@ -5,8 +5,8 @@ function createAssetViewingStore() {
|
||||
const viewingAssetStoreState = writable<AssetResponseDto>();
|
||||
const viewState = writable<boolean>(false);
|
||||
|
||||
const setAssetId = async (id: string) => {
|
||||
const { data } = await api.assetApi.getAssetById({ id });
|
||||
const setAssetId = async (id: string, key?: string) => {
|
||||
const { data } = await api.assetApi.getAssetById({ id, key });
|
||||
viewingAssetStoreState.set(data);
|
||||
viewState.set(true);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user