fix: share page load title error (#3111)

This commit is contained in:
Archer
2024-11-11 10:13:45 +08:00
committed by archer
parent 0201e63cfd
commit acdf6a0dd9
3 changed files with 13 additions and 10 deletions

View File

@@ -44,13 +44,14 @@ type Props = {
customUid: string;
};
const OutLink = ({
outLinkUid
}: Props & {
outLinkUid: string;
}) => {
const OutLink = (
props: Props & {
outLinkUid: string;
}
) => {
const { t } = useTranslation();
const router = useRouter();
const { outLinkUid } = props;
const {
shareId = '',
chatId = '',
@@ -297,6 +298,7 @@ const OutLink = ({
return (
<>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} />
<PageContainer
isLoading={loading}
{...(isEmbed
@@ -388,11 +390,12 @@ const Render = (props: Props) => {
return (
<>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} />
{systemLoaded && (
{systemLoaded ? (
<ChatContextProvider params={contextParams}>
<OutLink {...props} outLinkUid={contextParams.outLinkUid} />;
</ChatContextProvider>
) : (
<NextHead title="Loading..." />
)}
</>
);
@@ -425,9 +428,9 @@ export async function getServerSideProps(context: any) {
return {
props: {
appName: app?.appId?.name ?? 'name',
appName: app?.appId?.name ?? 'AI',
appAvatar: app?.appId?.avatar ?? '',
appIntro: app?.appId?.intro ?? 'intro',
appIntro: app?.appId?.intro ?? 'AI',
shareId: shareId ?? '',
authToken: authToken ?? '',
customUid,