|
|
@@ -32,6 +32,7 @@ import type { PageModel, PageDocument } from '~/server/models/page';
|
|
|
import type { PageRedirectModel } from '~/server/models/page-redirect';
|
|
|
import type { UserUISettingsModel } from '~/server/models/user-ui-settings';
|
|
|
import {
|
|
|
+ useCurrentUser,
|
|
|
useIsLatestRevision,
|
|
|
useIsForbidden, useIsNotFound, useIsSharedUser,
|
|
|
useIsEnabledStaleNotification, useIsIdenticalPath,
|
|
|
@@ -84,7 +85,7 @@ const {
|
|
|
} = pagePathUtils;
|
|
|
const { removeHeadingSlash } = pathUtils;
|
|
|
|
|
|
-type IPageToShowRevisionWithMeta = IDataWithMeta<IPagePopulatedToShowRevision & any, IPageInfoForEntity>;
|
|
|
+type IPageToShowRevisionWithMeta = IDataWithMeta<IPagePopulatedToShowRevision & PageDocument, IPageInfoForEntity>;
|
|
|
type IPageToShowRevisionWithMetaSerialized = IDataWithMeta<string, string>;
|
|
|
|
|
|
superjson.registerCustom<IPageToShowRevisionWithMeta, IPageToShowRevisionWithMetaSerialized>(
|
|
|
@@ -182,14 +183,15 @@ type Props = CommonProps & {
|
|
|
};
|
|
|
|
|
|
const Page: NextPageWithLayout<Props> = (props: Props) => {
|
|
|
- // const { t } = useTranslation();
|
|
|
- const router = useRouter();
|
|
|
-
|
|
|
// register global EventEmitter
|
|
|
if (isClient() && window.globalEmitter == null) {
|
|
|
window.globalEmitter = new EventEmitter();
|
|
|
}
|
|
|
|
|
|
+ const router = useRouter();
|
|
|
+
|
|
|
+ useCurrentUser(props.currentUser ?? null);
|
|
|
+
|
|
|
// commons
|
|
|
useEditorConfig(props.editorConfig);
|
|
|
useCsrfToken(props.csrfToken);
|