fix: fix website title with global config

pull/90/head
moonrailgun 2 years ago
parent e2309371df
commit 0922f83bb9

@ -21,6 +21,7 @@ export const SYSTEM_USERID = '000000000000000000000000';
export const defaultGlobalConfig: GlobalConfig = { export const defaultGlobalConfig: GlobalConfig = {
uploadFileLimit: 1 * 1024 * 1024, uploadFileLimit: 1 * 1024 * 1024,
emailVerification: false, emailVerification: false,
serverName: 'Tailchat',
disableUserRegister: false, disableUserRegister: false,
disableGuestLogin: false, disableGuestLogin: false,
}; };

@ -3,8 +3,8 @@
<head> <head>
<meta http-equiv="Content-Language" content="zh-CN" /> <meta http-equiv="Content-Language" content="zh-CN" />
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta name="keywords" content="im,chat,聊天,开源,即时通讯"> <meta name="keywords" content="im,chat,聊天,开源,即时通讯,Tailchat">
<meta name="description" content="开源即时通讯软件"> <meta name="description" content="Tailchat: Next generation noIM application in your own workspace, not only another Slack/Discord/Rocke.chat">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="force-rendering" content="webkit"> <meta name="force-rendering" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
@ -14,7 +14,6 @@
<meta property="og:site_name" content="Tailchat"> <meta property="og:site_name" content="Tailchat">
<meta property="og:image" content="https://tailchat.msgbyte.com/img/logo.svg"> <meta property="og:image" content="https://tailchat.msgbyte.com/img/logo.svg">
<link rel="manifest" href="/pwa.webmanifest"> <link rel="manifest" href="/pwa.webmanifest">
<title><%= htmlWebpackPlugin.options.title %></title>
<script> <script>
// vConsole DEBUG // vConsole DEBUG
if(location.search.indexOf('vconsole') >= 0) { if(location.search.indexOf('vconsole') >= 0) {

@ -56,7 +56,6 @@ const plugins: Configuration['plugins'] = [
'process.env.VERSION': JSON.stringify(VERSION), 'process.env.VERSION': JSON.stringify(VERSION),
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: 'Tailchat',
inject: true, inject: true,
hash: false, hash: false,
favicon: path.resolve(ROOT_PATH, './assets/images/favicon.ico'), favicon: path.resolve(ROOT_PATH, './assets/images/favicon.ico'),

@ -10,6 +10,7 @@ import {
sharedEvent, sharedEvent,
TcProvider, TcProvider,
useColorScheme, useColorScheme,
useGlobalConfigStore,
useLanguage, useLanguage,
} from 'tailchat-shared'; } from 'tailchat-shared';
import clsx from 'clsx'; import clsx from 'clsx';
@ -94,10 +95,14 @@ AppContainer.displayName = 'AppContainer';
const AppHeader: React.FC = React.memo(() => { const AppHeader: React.FC = React.memo(() => {
const { language } = useLanguage(); const { language } = useLanguage();
const { serverName } = useGlobalConfigStore((state) => ({
serverName: state.serverName,
}));
return ( return (
<Helmet> <Helmet>
<meta httpEquiv="Content-Language" content={language} /> <meta httpEquiv="Content-Language" content={language} />
<title>{serverName}</title>
</Helmet> </Helmet>
); );
}); });

Loading…
Cancel
Save