yohei0125 пре 4 година
родитељ
комит
efe64bd43b
1 измењених фајлова са 4 додато и 8 уклоњено
  1. 4 8
      packages/app/src/server/service/page.ts

+ 4 - 8
packages/app/src/server/service/page.ts

@@ -687,13 +687,6 @@ class PageService {
       );
     }
 
-    if (isRecursively) {
-      (async() => {
-        const descendantCountAppliedToAncestors = await this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
-        await this.updateDescendantCountOfAncestors(createdPage._id, descendantCountAppliedToAncestors, false);
-      })();
-    }
-
     // take over tags
     const originTags = await page.findRelatedTagsById();
     let savedTags = [];
@@ -708,7 +701,10 @@ class PageService {
 
     // TODO: resume
     if (isRecursively) {
-      this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
+      (async() => {
+        const descendantCountAppliedToAncestors = await this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
+        await this.updateDescendantCountOfAncestors(createdPage._id, descendantCountAppliedToAncestors, false);
+      })();
     }
 
     return result;