fix: set default value for the message owner (#597)

This commit is contained in:
Kelvin Chiu 2023-07-23 09:38:52 +08:00 committed by GitHub
parent 43e8dabc2c
commit b185161aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -59,7 +59,7 @@ class ChatPage extends BaseListPage {
newMessage(text) { newMessage(text) {
const randomName = Setting.getRandomName(); const randomName = Setting.getRandomName();
return { return {
owner: this.props.account.owner, // this.props.account.messagename, owner: "admin", // this.props.account.messagename,
name: `message_${randomName}`, name: `message_${randomName}`,
createdTime: moment().format(), createdTime: moment().format(),
// organization: this.props.account.owner, // organization: this.props.account.owner,

View File

@ -115,7 +115,7 @@ class MessageListPage extends React.Component {
title: i18next.t("general:Created time"), title: i18next.t("general:Created time"),
dataIndex: "createdTime", dataIndex: "createdTime",
key: "createdTime", key: "createdTime",
width: "130px", width: "120px",
sorter: (a, b) => a.createdTime.localeCompare(b.createdTime), sorter: (a, b) => a.createdTime.localeCompare(b.createdTime),
render: (text, record, index) => { render: (text, record, index) => {
return Setting.getFormattedDate(text); return Setting.getFormattedDate(text);
@ -129,7 +129,7 @@ class MessageListPage extends React.Component {
sorter: (a, b) => a.chat.localeCompare(b.chat), sorter: (a, b) => a.chat.localeCompare(b.chat),
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<Link to={`/chat/${text}`}> <Link to={`/chats/${text}`}>
{text} {text}
</Link> </Link>
); );
@ -139,12 +139,13 @@ class MessageListPage extends React.Component {
title: i18next.t("message:Reply to"), title: i18next.t("message:Reply to"),
dataIndex: "replyTo", dataIndex: "replyTo",
key: "replyTo", key: "replyTo",
width: "130px", width: "100px",
sorter: (a, b) => a.replyTo.localeCompare(b.replyTo), sorter: (a, b) => a.replyTo.localeCompare(b.replyTo),
render: (text, record, index) => { render: (text, record, index) => {
const textTemp = text.split("/")[1];
return ( return (
<Link to={`/message/${text}`}> <Link to={`/messages/${textTemp}`}>
{text} {textTemp}
</Link> </Link>
); );
}, },
@ -153,7 +154,7 @@ class MessageListPage extends React.Component {
title: i18next.t("message:Author"), title: i18next.t("message:Author"),
dataIndex: "author", dataIndex: "author",
key: "author", key: "author",
width: "120px", width: "100px",
sorter: (a, b) => a.author.localeCompare(b.author), sorter: (a, b) => a.author.localeCompare(b.author),
render: (text, record, index) => { render: (text, record, index) => {
return ( return (