1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

Remove useless code

This commit is contained in:
vrde 2015-10-20 11:35:32 +02:00
parent 4ee26d7259
commit 5f0329ccf6

View File

@ -2,26 +2,8 @@
/**
* Get the number of unread notifications in the title.
*
* @return {int} the number of unread notifications
*/
function getUnreadCount() {
const match = document.title.match(/^\((\d+)\)/);
return parseInt((match ? match[1] : 0), 10);
}
/**
* Set the title in the browser window while keeping the unread notification count (if any).
* Set the title in the browser window.
*/
export function setDocumentTitle(title) {
const count = getUnreadCount();
let newTitle = title;
if (count > 0) {
newTitle = `(${count}) ${newTitle}`;
}
document.title = newTitle;
document.title = title;
}