From 288856c93747ef4148171c77a23f97f4c75788a6 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Wed, 11 Dec 2024 19:09:58 -0700 Subject: [PATCH] Fix restore of groups/categories with docs Ref: #2801 --- CHANGELOG.md | 4 ++++ src/lib/models/ReflectionCategory.ts | 2 +- src/lib/models/ReflectionGroup.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d51c2189..419295374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ title: Changelog ## Unreleased +### Bug Fixes + +- Fix restoration of groups/categories including documents, #2801. + ## v0.27.4 (2024-12-09) ### Features diff --git a/src/lib/models/ReflectionCategory.ts b/src/lib/models/ReflectionCategory.ts index 2812dd8bf..9a28ccc0b 100644 --- a/src/lib/models/ReflectionCategory.ts +++ b/src/lib/models/ReflectionCategory.ts @@ -76,7 +76,7 @@ export class ReflectionCategory { const child = project.getReflectionById( de.oldIdToNewId[childId] ?? -1, ); - if (child?.isDeclaration()) { + if (child?.isDeclaration() || child?.isDocument()) { this.children.push(child); } } diff --git a/src/lib/models/ReflectionGroup.ts b/src/lib/models/ReflectionGroup.ts index c72d2f810..431525ced 100644 --- a/src/lib/models/ReflectionGroup.ts +++ b/src/lib/models/ReflectionGroup.ts @@ -96,7 +96,7 @@ export class ReflectionGroup { const child = project.getReflectionById( de.oldIdToNewId[childId] ?? -1, ); - if (child?.isDeclaration()) { + if (child?.isDeclaration() || child?.isDocument()) { this.children.push(child); } }