Add updating of window title on launch
The window title show the number of global unread messages when the inbox window launches.
This commit is contained in:
parent
156c7c3b3d
commit
86edcc06c2
1 changed files with 4 additions and 2 deletions
|
@ -43,6 +43,10 @@
|
|||
appWindow = windowInfo;
|
||||
inboxWindowId = appWindow.id;
|
||||
|
||||
appWindow.contentWindow.addEventListener('load', function() {
|
||||
setUnreadCount(storage.get("unreadCount", 0));
|
||||
});
|
||||
|
||||
appWindow.onClosed.addListener(function () {
|
||||
inboxOpened = false;
|
||||
appWindow = null;
|
||||
|
@ -75,13 +79,11 @@
|
|||
if (count > 0) {
|
||||
extension.navigator.setBadgeText(count);
|
||||
if (inboxOpened === true) {
|
||||
var appWindow = chrome.app.window.get(inboxWindowId);
|
||||
appWindow.contentWindow.document.title = "Signal (" + count + ")";
|
||||
}
|
||||
} else {
|
||||
extension.navigator.setBadgeText("");
|
||||
if (inboxOpened === true) {
|
||||
var appWindow = chrome.app.window.get(inboxWindowId);
|
||||
appWindow.contentWindow.document.title = "Signal";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue