Add option to hide the notification count in the twitter title #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to hide the notification count in the title of twitter.
It's a setting that can be set to true (DO hide notifications) or false (DON'T hide them).
If you refresh the page, it works just as you'd expect.
However, if you're on the page and change the setting, things get a little complicated.
There's 3 implementations I could think of-
Switching from true->false requires a refresh, switching from false->true kicks in immediately.
This is what I went with. The user can see right away when they switch from false to true that it's working.
If they switch from true to false, then it kind of just reads as "I don't have any new notifications."
Switching from true->false requires a refresh to kick in, switching from false->true requires a refresh to kick in.
This feels worse than number 1, however it would be more consistent.
Everything kicks in immediately.
While this is ideal, to make the true->false case work dynamically you'd need to keep track of the notification count as the user is browsing twitter. At the very least you'd have to make a couple new global objects that communicate with main.js/changeTitleNotifications, I think. It would be pretty messy and doesn't really feel worth it.