diff --git a/extension/js/common/message-renderer.ts b/extension/js/common/message-renderer.ts index 98125281405..375b03adb25 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(); + }, 60 * 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 () => {