Skip to content

Commit

Permalink
Fix expanded header row display
Browse files Browse the repository at this point in the history
You can't add the header row update listener before you've initialized
the expanded header row!
  • Loading branch information
jikamens committed Aug 7, 2023
1 parent eab1b04 commit f042f65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f042f65

Please sign in to comment.