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

[Deploy] Glowing Bear #69

Closed
jonathanjuursema opened this Issue Nov 22, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@jonathanjuursema
Copy link

jonathanjuursema commented Nov 22, 2017

Service

Glowing Bear - WeeChat web front-end

Link to your repository

https://github.com/jonathanjuursema/franz-glowingbear

@adlk

This comment has been minimized.

Copy link
Contributor

adlk commented Nov 25, 2017

While checking your recipe I've discovered the following issue:

  • webview.js: badge number for direct and indirect messages must always be 0 or greater. Never negative (-1).

@adlk adlk added the incomplete label Nov 25, 2017

@jonathanjuursema

This comment has been minimized.

Copy link
Author

jonathanjuursema commented Nov 25, 2017

@adlk the thing is that Glowing Bear not only shows the message count per channel, but also an aggregated message count in the top of it's UI. This is not an 'additional' unread channel, but just a summation of all unread counts for every channel. I do the -1 thing to make sure it is not counted.

However, to be sure that the function will never return -1 as a message count, even if Glowing Bear changes their UI, I have enclosed both return values (indirect and direct) in a Math.max(count, 0) statement so the return value is at least 0. Hope that suffices. :)

(Edit) Additionally: while the Glowing Bear UI will only add the count badges to the DOM for channels if there is a notification, the aggregated counter on the top is always present in the DOM but hidden by CSS. So even if there's 0 unread channels, it will still count the aggregated count. So in practice, the function would already not return negatives values. However, added change also makes sure the count can never be negative even if Glowing Bear changes their UI.

@adlk

This comment has been minimized.

Copy link
Contributor

adlk commented Nov 26, 2017

Thank you for clearing things up. Currently Franz is not checking for negative numbers, therefore I had to make sure about this.

Thanks for your contribution, I'll publish your recipe soon.

@adlk

This comment has been minimized.

Copy link
Contributor

adlk commented Nov 27, 2017

Deployed, thanks for your contribution.

@adlk adlk closed this Nov 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.