fix(mobile): stack count reset when navigating to library (#4647)

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2023-10-26 14:19:06 +00:00
committed by GitHub
parent cb0e37e76e
commit b49b10141e
9 changed files with 52 additions and 23 deletions

View File

@@ -6009,6 +6009,7 @@
"type": "array"
},
"stackCount": {
"nullable": true,
"type": "integer"
},
"stackParentId": {

View File

@@ -45,7 +45,7 @@ export class AssetResponseDto extends SanitizedAssetResponseDto {
stackParentId?: string | null;
stack?: AssetResponseDto[];
@ApiProperty({ type: 'integer' })
stackCount!: number;
stackCount!: number | null;
}
export type AssetMapOptions = {
@@ -102,7 +102,7 @@ export function mapAsset(entity: AssetEntity, options: AssetMapOptions = {}): As
checksum: entity.checksum.toString('base64'),
stackParentId: entity.stackParentId,
stack: withStack ? entity.stack?.map((a) => mapAsset(a, { stripMetadata })) ?? undefined : undefined,
stackCount: entity.stack?.length ?? 0,
stackCount: entity.stack?.length ?? null,
isExternal: entity.isExternal,
isOffline: entity.isOffline,
isReadOnly: entity.isReadOnly,