Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Zulip.js #180

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/components/Zulip.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,28 @@ class Zulip extends Component {
<>
<b>Streams: </b>
<br />
<ul>
{zulipstat && zulipstat[0] ? <ul>
<li>
<b>#newcomers: </b>
{zulipstat[0] ? zulipstat[0].newcomers_messages : 0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing this?
You need to change the condition so that it can render without any errors.

{zulipstat && zulipstat[0] && zulipstat[0].newcomers_message ? zulipstat[0].newcomers_message : 0}

Same change for other lines also.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codesankalp can you please check if I made the right changes?

{zulipstat[0].newcomers_message ? zulipstat[0].newcomers_message : 0}
</li>
<li>
<b>#celebrate: </b>
{zulipstat[0] ? zulipstat[0].celebrate_messages : 0}
{zulipstat[0].celebrate_message ? zulipstat[0].celebrate_message : 0}
</li>
<li>
<b>#opportunities: </b>
{zulipstat[0] ? zulipstat[0].opportunities_messages : 0}
{zulipstat[0].opportunities_message ? zulipstat[0].opportunities_message : 0}
</li>
<li>
<b>#questions: </b>
{zulipstat[0] ? zulipstat[0].questions_messages : 0}
{zulipstat[0].questions_message ? zulipstat[0].questions_message : 0}
</li>
<li>
<b>#general: </b>
{zulipstat[0] ? zulipstat[0].general_messages : 0}
{zulipstat[0].general_message ? zulipstat[0].general_message : 0}
</li>
</ul>
</ul> : null}
</>
) : null}
</>
Expand Down