Skip to content

Commit

Permalink
#5830 Move deleteExpired logic to messageRenderer and perform once pe…
Browse files Browse the repository at this point in the history
…r minute instead of every seconds (#5840)

* fix: move deleteExpired logic to messageRenderer

* fix: timer
  • Loading branch information
ioanmo226 authored Sep 20, 2024
1 parent f20e37d commit 6cb74ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions extension/js/common/message-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 6cb74ee

Please sign in to comment.