diff --git a/src/helpers/GroupHelper.ts b/src/helpers/GroupHelper.ts index 17583d1..143163a 100644 --- a/src/helpers/GroupHelper.ts +++ b/src/helpers/GroupHelper.ts @@ -1,4 +1,4 @@ -import { IGroup } from "@/store/groups/types"; +import { GroupState, IGroup } from "@/store/groups/types"; import { FiltersType, GroupsSortEnum, @@ -6,7 +6,7 @@ import { OnlyAccessEnum, useGroups, } from "@/store/groups/groups"; -import { getGroupState, GroupState } from "@/pages/AGroups/getGroupState"; +import { getGroupState } from "@/pages/AGroups/getGroupState"; import bridge from "@vkontakte/vk-bridge"; import { from, IEnumerable, NumberComparer } from "linq-to-typescript"; diff --git a/src/helpers/PhotoHelper.ts b/src/helpers/PhotoHelper.ts index 468389b..700153a 100644 --- a/src/helpers/PhotoHelper.ts +++ b/src/helpers/PhotoHelper.ts @@ -1,8 +1,9 @@ -import { IPhoto, IPhotoSize } from "vkontakte-api"; +import { IPhotoSize } from "vkontakte-api"; import last from "lodash/last"; import isNumeric from "@/helpers/isNumeric"; import { VK_MAX_PHOTO_SIZE } from "@/common/consts"; import { ComputedRef } from "vue"; +import { IPhoto, IPhotoKey } from "@/store/groups/types"; export class PhotoHelper { static getOriginalSize(sizes: IPhotoSize[] | undefined) { @@ -59,10 +60,27 @@ export class PhotoHelper { return `vk.com/id${ownerId}`; } - static getPhotoUrl(ownerId: number | string, photoId: number) { + static getPhotoUrl(ownerId: number | string, photoId: number | string) { return `vk.com/photo${ownerId}_${photoId}`; } + static getPhotoKey( + ownerId: number | string, + photoId: number | string, + ): IPhotoKey { + return `photo${ownerId}_${photoId}`; + } + + static getPhotoKeyOrUndefined( + ownerId: number | string | undefined, + photoId: number | string | undefined, + ): IPhotoKey | undefined { + if (ownerId === undefined || photoId === undefined) { + return undefined; + } + return this.getPhotoKey(ownerId, photoId); + } + static getPhotoFileName(photo: IPhoto) { return `photo${photo.owner_id}_${photo.id}.jpg`; } diff --git a/src/pages/AAlbum/AAlbumPreview.vue b/src/pages/AAlbum/AAlbumPreview.vue index 9e42aab..a3a20ec 100644 --- a/src/pages/AAlbum/AAlbumPreview.vue +++ b/src/pages/AAlbum/AAlbumPreview.vue @@ -1,5 +1,4 @@