Shun Miyazawa пре 3 година
родитељ
комит
4c6869019f
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      packages/app/src/pages/share/[[...path]].page.tsx

+ 6 - 1
packages/app/src/pages/share/[[...path]].page.tsx

@@ -10,6 +10,7 @@ import dynamic from 'next/dynamic';
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
 import GrowiContextualSubNavigation from '~/components/Navbar/GrowiContextualSubNavigation';
 import { Page } from '~/components/Page';
+import { SupportedAction } from '~/interfaces/activity';
 import { CrowiRequest } from '~/interfaces/crowi-request';
 import { RendererConfig } from '~/interfaces/services/renderer';
 import { IShareLinkHasId } from '~/interfaces/share-link';
@@ -19,7 +20,7 @@ import {
 } from '~/stores/context';
 
 import {
-  CommonProps, getServerSideCommonProps, useCustomTitle, getNextI18NextConfig,
+  CommonProps, getServerSideCommonProps, useCustomTitle, getNextI18NextConfig, addActivity,
 } from '../utils/commons';
 
 const ShareLinkAlert = dynamic(() => import('~/components/Page/ShareLinkAlert'), { ssr: false });
@@ -161,6 +162,10 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
   // await injectUserUISettings(context, props);
   await injectNextI18NextConfigurations(context, props);
 
+  // eslint-disable-next-line max-len, no-nested-ternary
+  const action = props.isExpired ? SupportedAction.ACTION_SHARE_LINK_EXPIRED_PAGE_VIEW : props.shareLink == null ? SupportedAction.ACTION_SHARE_LINK_NOT_FOUND : SupportedAction.ACTION_SHARE_LINK_PAGE_VIEW;
+  await addActivity(context, action);
+
   return {
     props,
   };