|
|
@@ -10,7 +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 { SupportedAction, SupportedActionType } from '~/interfaces/activity';
|
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
import { RendererConfig } from '~/interfaces/services/renderer';
|
|
|
import { IShareLinkHasId } from '~/interfaces/share-link';
|
|
|
@@ -162,8 +162,17 @@ 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;
|
|
|
+ let action: SupportedActionType;
|
|
|
+ if (props.isExpired) {
|
|
|
+ action = SupportedAction.ACTION_SHARE_LINK_EXPIRED_PAGE_VIEW;
|
|
|
+ }
|
|
|
+ else if (props.shareLink == null) {
|
|
|
+ action = SupportedAction.ACTION_SHARE_LINK_NOT_FOUND;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ action = SupportedAction.ACTION_SHARE_LINK_PAGE_VIEW;
|
|
|
+ }
|
|
|
+
|
|
|
await addActivity(context, action);
|
|
|
|
|
|
return {
|