summaryrefslogtreecommitdiffstats
path: root/mailnews/base/prefs/content/AccountManager.js
diff options
context:
space:
mode:
Diffstat (limited to 'mailnews/base/prefs/content/AccountManager.js')
-rw-r--r--mailnews/base/prefs/content/AccountManager.js20
1 files changed, 4 insertions, 16 deletions
diff --git a/mailnews/base/prefs/content/AccountManager.js b/mailnews/base/prefs/content/AccountManager.js
index 83117f4ad..81fb115de 100644
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -704,7 +704,7 @@ function onSetDefault(event) {
if (event.target.getAttribute("disabled") == "true")
return;
- let previousDefault = getDefaultAccount();
+ let previousDefault = MailServices.accounts.defaultAccount;
MailServices.accounts.defaultAccount = currentAccount;
markDefaultServer(currentAccount, previousDefault);
@@ -771,7 +771,7 @@ function onRemoveAccount(event) {
// Either the default account was deleted so there is a new one
// or the default account was not changed. Either way, there is
// no need to unmark the old one.
- markDefaultServer(getDefaultAccount(), null);
+ markDefaultServer(MailServices.accounts.defaultAccount, null);
}
function saveAccount(accountValues, account)
@@ -928,7 +928,7 @@ function updateItems(tree, account, addAccountItem, setDefaultItem, removeItem)
// problem. Either way, we don't want the user to act on it.
let server = account.incomingServer;
- if (account != getDefaultAccount() &&
+ if (account != MailServices.accounts.defaultAccount &&
server.canBeDefaultServer && account.identities.length > 0)
canSetDefault = true;
@@ -1379,18 +1379,6 @@ function getCurrentAccount()
}
/**
- * Returns the default account without throwing exception if there is none.
- * The account manager can be opened even if there are no account yet.
- */
-function getDefaultAccount() {
- try {
- return MailServices.accounts.defaultAccount;
- } catch (e) {
- return null; // No default account yet.
- }
-}
-
-/**
* Get the array of persisted form elements for the given page.
*/
function getPageFormElements() {
@@ -1605,7 +1593,7 @@ var gAccountTree = {
treeitem._account = account;
}
- markDefaultServer(getDefaultAccount(), null);
+ markDefaultServer(MailServices.accounts.defaultAccount, null);
// Now add the outgoing server node.
var treeitem = document.createElement("treeitem");