|
|
@@ -399,6 +399,11 @@ async function injectPageData(context: GetServerSidePropsContext, props: Props):
|
|
|
const pageWithMeta: IPageToShowRevisionWithMeta = await pageService.findPageAndMetaDataByViewer(pageId, currentPathname, user, true); // includeEmpty = true, isSharedPage = false
|
|
|
const page = pageWithMeta?.data as unknown as PageDocument;
|
|
|
|
|
|
+ // add user to seen users
|
|
|
+ if (page != null && user != null) {
|
|
|
+ await page.seen(user);
|
|
|
+ }
|
|
|
+
|
|
|
// populate & check if the revision is latest
|
|
|
if (page != null) {
|
|
|
page.initLatestRevisionField(revisionId);
|
|
|
@@ -406,11 +411,6 @@ async function injectPageData(context: GetServerSidePropsContext, props: Props):
|
|
|
props.isLatestRevision = page.isLatestRevision();
|
|
|
}
|
|
|
|
|
|
- // add user to seen users
|
|
|
- if (page != null && user != null) {
|
|
|
- await page.seen(user);
|
|
|
- }
|
|
|
-
|
|
|
props.pageWithMeta = pageWithMeta;
|
|
|
}
|
|
|
|