Explorar o código

fix: increment page view count for seen users on same-route navigation

Shun Miyazawa hai 4 meses
pai
achega
ec53f158ca
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      apps/app/src/pages/[[...path]]/page-data-props.ts

+ 5 - 0
apps/app/src/pages/[[...path]]/page-data-props.ts

@@ -286,6 +286,11 @@ export async function getPageDataForSameRoute(
     isPermalink ? { _id: pageId } : { path: resolvedPagePath },
   ).exec();
 
+  // Add user to seen users
+  if (user != null) {
+    await basicPageInfo?.seen(user);
+  }
+
   const currentPathname = resolveFinalizedPathname(
     resolvedPagePath,
     basicPageInfo,