From f042f65c8e768cb2acbefb154c925a40abd5ceda Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Mon, 7 Aug 2023 18:56:23 -0400 Subject: [PATCH] Fix expanded header row display You can't add the header row update listener before you've initialized the expanded header row! --- background.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index fa2f6d6d..bdb43506 100644 --- a/background.js +++ b/background.js @@ -739,9 +739,16 @@ const SendLater = { // We won't get events for tabs that are already loaded. SendLater.configureAllTabs(); + // Initialize expanded header row + await messenger.headerView.addCustomHdrRow({ + name: messenger.i18n.getMessage("sendlater3header.label"), + }).catch(ex => { + SLStatic.error("headerView.addCustomHdrRow",ex); + }); messenger.headerView.onHeaderRowUpdate.addListener( SendLater.headerRowUpdateListener, messenger.i18n.getMessage("sendlater3header.label") ); + messenger.messages.onNewMailReceived.addListener(SendLater.onNewMailReceivedListener); // Set custom DB headers preference, if not already set. @@ -788,13 +795,6 @@ const SendLater = { SLStatic.error(ex); } - // Initialize expanded header row - await messenger.headerView.addCustomHdrRow({ - name: messenger.i18n.getMessage("sendlater3header.label"), - }).catch(ex => { - SLStatic.error("headerView.addCustomHdrRow",ex); - }); - // Attach to all existing msgcompose windows messenger.SL3U.hijackComposeWindowKeyBindings().catch(ex => { SLStatic.error("SL3U.hijackComposeWindowKeyBindings",ex);