Bug 1554237 - Make callers of atStartupRestoreTabs() async and await it. r=mkmelin
authoralta88@fixall.com
Tue, 28 May 2019 19:59:25 +0200
changeset 35698 34903ebb73e2e53f2eb5a84ce274f0ae5dc63d6e
parent 35697 6cefc7883cb3f1dd040fc269ddb57bdca65ecb66
child 35699 588c1b465632525681d16fa331842ca610771504
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1554237
Bug 1554237 - Make callers of atStartupRestoreTabs() async and await it. r=mkmelin
mail/base/content/msgMail3PaneWindow.js
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -828,30 +828,30 @@ function loadExtraTabs() {
 }
 
 /**
  * Loads the given message header at window open. Exactly one out of this and
  * |loadStartFolder| should be called.
  *
  * @param aStartMsgHdr The message header to load at window open
  */
-function loadStartMsgHdr(aStartMsgHdr) {
+async function loadStartMsgHdr(aStartMsgHdr) {
   // We'll just clobber the default tab
-  atStartupRestoreTabs(true);
+  await atStartupRestoreTabs(true);
 
   MsgDisplayMessageInFolderTab(aStartMsgHdr);
 }
 
-function loadStartFolder(initialUri) {
+async function loadStartFolder(initialUri) {
   var defaultServer = null;
   var startFolder;
   var isLoginAtStartUpEnabled = false;
 
   // If a URI was explicitly specified, we'll just clobber the default tab
-  let loadFolder = !atStartupRestoreTabs(!!initialUri);
+  let loadFolder = !(await atStartupRestoreTabs(!!initialUri));
 
   if (initialUri)
     loadFolder = true;
 
   // First get default account
   try {
     if (initialUri) {
         startFolder = MailUtils.getOrCreateFolder(initialUri);