From d443f988813335837f22d65643a138311919414e Mon Sep 17 00:00:00 2001 From: Ioan Moldovan Date: Fri, 20 Sep 2024 03:33:28 +0300 Subject: [PATCH 1/2] fix: move deleteExpired logic to messageRenderer --- extension/js/common/message-renderer.ts | 4 ++++ .../content_scripts/webmail/gmail/gmail-element-replacer.ts | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/js/common/message-renderer.ts b/extension/js/common/message-renderer.ts index 98125281405..0fab78c5811 100644 --- a/extension/js/common/message-renderer.ts +++ b/extension/js/common/message-renderer.ts @@ -55,6 +55,10 @@ export class MessageRenderer { private debug = false ) { this.downloader = new Downloader(gmail); + // Check expired messages every minute and delete them + Catch.setHandledInterval(() => { + this.deleteExpired(); + }, 3 * 1000); } public static async newInstance(acctEmail: string, gmail: Gmail, relayManager: RelayManager, factory: XssSafeFactory, debug = false) { diff --git a/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts b/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts index fa012e9b6d9..f8a38d20da8 100644 --- a/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts +++ b/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts @@ -152,7 +152,6 @@ export class GmailElementReplacer extends WebmailElementReplacer { this.evaluateStandardComposeRecipients().catch(Catch.reportErr); this.addSettingsBtn(); this.renderLocalDrafts().catch(Catch.reportErr); - this.messageRenderer.deleteExpired(); }; private replaceArmoredBlocks = async () => { From d4ba8640f217adcea3815198652bf33daa224df7 Mon Sep 17 00:00:00 2001 From: Ioan Moldovan Date: Fri, 20 Sep 2024 07:32:36 +0300 Subject: [PATCH 2/2] fix: timer --- extension/js/common/message-renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/js/common/message-renderer.ts b/extension/js/common/message-renderer.ts index 0fab78c5811..375b03adb25 100644 --- a/extension/js/common/message-renderer.ts +++ b/extension/js/common/message-renderer.ts @@ -58,7 +58,7 @@ export class MessageRenderer { // Check expired messages every minute and delete them Catch.setHandledInterval(() => { this.deleteExpired(); - }, 3 * 1000); + }, 60 * 1000); } public static async newInstance(acctEmail: string, gmail: Gmail, relayManager: RelayManager, factory: XssSafeFactory, debug = false) {