diff --git a/web/src/ChatBox.js b/web/src/ChatBox.js index 8bf1f218..fd3b7a56 100644 --- a/web/src/ChatBox.js +++ b/web/src/ChatBox.js @@ -49,27 +49,38 @@ class ChatBox extends React.Component { ( - -
- } - title={
{item.text}
} - /> -
- - - + dataSource={this.props.messages === undefined ? undefined : [...this.props.messages, {}]} + renderItem={(item, index) => { + if (Object.keys(item).length === 0 && item.constructor === Object) { + return ; + } + + return ( + +
+ } + title={
{item.text}
} + /> +
+ + + +
-
- - )} + + ); + }} />
item.key); + this.state = { - openKeys: ["0"], + openKeys: openKeys, selectedKeys: ["0-0"], }; } diff --git a/web/src/ChatPage.js b/web/src/ChatPage.js index b37105d7..c8e9996b 100644 --- a/web/src/ChatPage.js +++ b/web/src/ChatPage.js @@ -13,6 +13,7 @@ // limitations under the License. import React from "react"; +import {Spin} from "antd"; import moment from "moment"; import ChatMenu from "./ChatMenu"; import ChatBox from "./ChatBox"; @@ -76,18 +77,20 @@ class ChatPage extends BaseListPage { } renderTable(chats) { - return ( -
-
- { - const chat = chats[i]; - this.getMessages(chat.name); - }} /> + return (this.state.loading) ? : ( + ( +
+
+ { + const chat = chats[i]; + this.getMessages(chat.name); + }} /> +
+
+ +
-
- -
-
+ ) ); }