mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-11-02 03:15:50 +01:00
Fix new mail update
This commit is contained in:
@@ -241,25 +241,26 @@ SysTrayX.Messaging = {
|
|||||||
|
|
||||||
listenerFolderInfoChanged: async function (folder, folderInfo) {
|
listenerFolderInfoChanged: async function (folder, folderInfo) {
|
||||||
|
|
||||||
//console.debug("folderInfoChanged: folder: " + JSON.stringify(folder));
|
console.debug("folderInfoChanged: folder: " + JSON.stringify(folder));
|
||||||
//console.debug("folderInfoChanged: folderinfo: " + JSON.stringify(folderInfo));
|
console.debug("folderInfoChanged: folderinfo: " + JSON.stringify(folderInfo));
|
||||||
//console.debug("folderInfoChanged: Cache: " + SysTrayX.Messaging.folderInfoChangeCache.length );
|
//console.debug("folderInfoChanged: Cache: " + SysTrayX.Messaging.folderInfoChangeCache.length );
|
||||||
|
|
||||||
if (SysTrayX.Info.browserInfo.majorVersion < 115 || SysTrayX.Messaging.apiCountMethod === "false") {
|
if (SysTrayX.Info.browserInfo.majorVersion < 115 || SysTrayX.Messaging.apiCountMethod === "false") {
|
||||||
|
if (!SysTrayX.Messaging.startupDelayFinished) {
|
||||||
// Cache the folder change
|
// Cache the folder change
|
||||||
if (folder)
|
if (folder)
|
||||||
{
|
{
|
||||||
SysTrayX.Messaging.folderInfoChangeCache.push({ folder, folderInfo });
|
SysTrayX.Messaging.folderInfoChangeCache.push({ folder, folderInfo });
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (SysTrayX.Messaging.startupDelayFinished)
|
if (SysTrayX.Messaging.startupDelayFinished)
|
||||||
{
|
{
|
||||||
//console.debug("folderInfoChanged: delay finished");
|
console.debug("folderInfoChanged: delay finished");
|
||||||
|
|
||||||
if( SysTrayX.Messaging.folderInfoChangeCache.length > 0 ) {
|
if( SysTrayX.Messaging.folderInfoChangeCache.length > 0 ) {
|
||||||
|
|
||||||
//console.debug("folderInfoChanged: handle cache");
|
console.debug("folderInfoChanged: handle cache");
|
||||||
|
console.debug("FolderInfoChanged: cache: " + JSON.stringify(SysTrayX.Messaging.folderInfoChangeCache));
|
||||||
|
|
||||||
// Process the received messages
|
// Process the received messages
|
||||||
for (const cache of SysTrayX.Messaging.folderInfoChangeCache) {
|
for (const cache of SysTrayX.Messaging.folderInfoChangeCache) {
|
||||||
@@ -276,6 +277,8 @@ SysTrayX.Messaging = {
|
|||||||
SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path] = [];
|
SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.debug("FolderInfoChanged: Unread: " + JSON.stringify(cache.folderInfo.unreadMessageCount));
|
||||||
|
|
||||||
SysTrayX.Messaging.unread[cache.folder.accountId][cache.folder.path] =
|
SysTrayX.Messaging.unread[cache.folder.accountId][cache.folder.path] =
|
||||||
cache.folderInfo.unreadMessageCount;
|
cache.folderInfo.unreadMessageCount;
|
||||||
|
|
||||||
@@ -298,7 +301,7 @@ SysTrayX.Messaging = {
|
|||||||
|
|
||||||
//console.debug("FolderInfoChanged: Clear");
|
//console.debug("FolderInfoChanged: Clear");
|
||||||
//console.debug("FolderInfoChanged: Old: " + JSON.stringify(SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path]));
|
//console.debug("FolderInfoChanged: Old: " + JSON.stringify(SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path]));
|
||||||
//console.debug("FolderInfoChanged: New: " + JSON.stringify(newMessages));
|
console.debug("FolderInfoChanged: New: " + JSON.stringify(newMessages));
|
||||||
|
|
||||||
SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path] = [
|
SysTrayX.Messaging.new[cache.folder.accountId][cache.folder.path] = [
|
||||||
...newMessages,
|
...newMessages,
|
||||||
@@ -311,7 +314,7 @@ SysTrayX.Messaging = {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//console.debug("folderInfoChanged: handle default");
|
console.debug("folderInfoChanged: handle default");
|
||||||
|
|
||||||
// Count the initial unread messages
|
// Count the initial unread messages
|
||||||
for (const filter of SysTrayX.Messaging.filters) {
|
for (const filter of SysTrayX.Messaging.filters) {
|
||||||
@@ -388,6 +391,7 @@ SysTrayX.Messaging = {
|
|||||||
}
|
}
|
||||||
sendMailCountPre115();
|
sendMailCountPre115();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (SysTrayX.Messaging.startupDelayFinished)
|
if (SysTrayX.Messaging.startupDelayFinished)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user