minimalchat / operator-app

Cross-platform operator application for Minimal Chat
https://minimal.chat
BSD 3-Clause "New" or "Revised" License
43 stars 7 forks source link

show no chat selected screen #111

Open satyamyadav opened 5 years ago

satyamyadav commented 5 years ago

Relevant code or config

What you did:

What happened:

Screenshot 2019-04-27 at 15 13 19 Screenshot 2019-04-27 at 15 18 32

Reproduction repository:

Problem description:

In renderEmpty method of MessageList there are two if blocks , first one is working as expected but the second one have a condition is as follow :

if (chat.hasOwnProperty('open')) {
      return (
        <div className="MessageList__empty">
          <div className="ss-icon ss-mailbox lil-mailbox" />
          <div>No chat selected</div>
          <div style={{ fontSize: '12px', padding: '10px' }}>Click a chat on the left to get started!</div>
        </div>
      );
    }

I don't know if it was working previously or not , but I don't think if no chat is selected the open key will be present in chat and so the if block will be useless.

Suggested solution: I have tried removing the if condition and returning template directly , It works as expected in both cases , when chat list is empty and when no chat is selected. Let me know if there is anything I am missing, if not then I will create a pull request updating it.