mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-11-09 14:56:07 +01:00
Fix startup
This commit is contained in:
@@ -45,18 +45,18 @@ SysTrayX.Messaging = {
|
||||
}
|
||||
*/
|
||||
|
||||
browser.folderChange.onUnreadMailChange.addListener(function (unread) {
|
||||
console.debug("folderChangeListener: " + unread);
|
||||
|
||||
SysTrayX.Messaging.unreadCb(unread);
|
||||
});
|
||||
|
||||
// Set the count type in the folderChange listener
|
||||
browser.folderChange.setCountType(Number(SysTrayX.Messaging.countType));
|
||||
|
||||
// Set the filters in the folderChange listener
|
||||
browser.folderChange.setFilters(SysTrayX.Messaging.filtersExt);
|
||||
|
||||
browser.folderChange.onUnreadMailChange.addListener(function (unread) {
|
||||
console.debug("folderChangeListener: " + unread);
|
||||
|
||||
SysTrayX.Messaging.unreadCb(unread)
|
||||
});
|
||||
|
||||
// Try to catch the window state
|
||||
browser.windows.onFocusChanged.addListener(SysTrayX.Window.focusChanged);
|
||||
},
|
||||
|
||||
@@ -136,9 +136,6 @@ var SysTrayX = {
|
||||
// Get the mail accounts using MailServices
|
||||
this.getAccounts();
|
||||
|
||||
// Trigger first count
|
||||
this.updateMsgCountWithCb();
|
||||
|
||||
// Start listener
|
||||
MailServices.mailSession.AddFolderListener(
|
||||
this.mailSessionListener,
|
||||
@@ -162,11 +159,13 @@ var SysTrayX = {
|
||||
},
|
||||
|
||||
setCountType: function (type) {
|
||||
console.debug("setCountType: " + type);
|
||||
|
||||
if (type === 0) {
|
||||
this.countType = this.MESSAGE_COUNT_TYPE_UNREAD;
|
||||
} else if (type === 1) {
|
||||
this.countType = this.MESSAGE_COUNT_TYPE_NEW;
|
||||
} else console.log("Unknown count type");
|
||||
} else console.log("Unknown count type: " + type);
|
||||
|
||||
// Update count
|
||||
this.updateMsgCountWithCb();
|
||||
@@ -281,7 +280,7 @@ var SysTrayX = {
|
||||
this.countMessages("UnreadMessages");
|
||||
} else if (msgCountType === SysTrayX.MESSAGE_COUNT_TYPE_NEW) {
|
||||
this.countMessages("HasNewMessages");
|
||||
} else console.error("Unknown message count type");
|
||||
} else console.error("Unknown message count type: " + msgCountType);
|
||||
|
||||
// currentMsgCount and newMsgCount may be integers or bool, which do
|
||||
// also support comparison operations
|
||||
|
||||
Reference in New Issue
Block a user