yohei0125 4 лет назад
Родитель
Сommit
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;