Skip to content

Commit

Permalink
Fix asterix conflict with talk
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jun 21, 2021
1 parent f2d1a05 commit 2287957
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions js/notifications-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-main.js.map

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,12 @@ export default {
* @param {Object} notifications The list of notifications
*/
_updateDocTitleOnNewNotifications(notifications) {
if (notifications.length < this._oldcount) {
this._restoreTitle()
this._oldcount = notifications.length
} else if (notifications.length > this._oldcount) {
if (notifications.length > this._oldcount) {
this._oldcount = notifications.length
if (this.backgroundFetching && document.hidden) {
// If we didn't already highlight, store the title so we can restore on tab-view
if (self._setTitle !== document.title) {
self._storedTitle = document.title
self._setTitle = '* ' + document.title
document.title = self._setTitle
if (!document.title.startsWith('* ')) {
document.title = '* ' + document.title
}
}
}
Expand All @@ -270,9 +265,8 @@ export default {
* the Talk might have altered it.
*/
_restoreTitle() {
if (self._setTitle === document.title) {
document.title = self._storedTitle
self._setTitle = null
if (document.title.startsWith('* ')) {
document.title = document.title.substring(2)
}
},
Expand Down

0 comments on commit 2287957

Please sign in to comment.