mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
inlined function used to filter for the owned assets
This commit is contained in:
parent
b8f56c1393
commit
7809277366
2 changed files with 3 additions and 7 deletions
|
|
@ -11,7 +11,7 @@
|
|||
toIsoDate,
|
||||
type ZoneOption,
|
||||
} from '$lib/modals/timezone-utils';
|
||||
import { getOwnedAssetsObjects, getOwnedAssetsWithWarning } from '$lib/utils/asset-utils';
|
||||
import { getOwnedAssetsWithWarning } from '$lib/utils/asset-utils';
|
||||
import { getFullDateFormat } from '$lib/utils/date-time';
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
import { updateAssets } from '@immich/sdk';
|
||||
|
|
@ -68,8 +68,8 @@
|
|||
},
|
||||
});
|
||||
|
||||
let updatedAssets = getOwnedAssetsObjects(assets, authManager.user);
|
||||
for (let asset of updatedAssets) {
|
||||
const updatedAssets = assets.filter((a) => authManager.user && a.ownerId === authManager.user.id);
|
||||
for (const asset of updatedAssets) {
|
||||
asset.localOffsetHours = selectedOption.offsetMinutes / 60;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -284,10 +284,6 @@ export const getOwnedAssetsWithWarning = (assets: TimelineAsset[], user: UserRes
|
|||
return ids;
|
||||
};
|
||||
|
||||
export const getOwnedAssetsObjects = (assets: TimelineAsset[], user: UserResponseDto | null): TimelineAsset[] => {
|
||||
return [...assets].filter((a) => user && a.ownerId === user.id);
|
||||
};
|
||||
|
||||
export type StackResponse = {
|
||||
stack?: StackResponseDto;
|
||||
toDeleteIds: string[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue