Skip to content

Commit

Permalink
improve account loading flow #153
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Jul 29, 2024
1 parent 477ea52 commit 35145c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ messenger.runtime.onInstalled.addListener(async function (details) {

messenger.accounts.onCreated.addListener(async function (id, account) {
rwhLogger.debug('onCreated', id, account);
if (account.type === 'imap' || account.type === 'pop3') {
rwhSettings.setDefault(`${id}.enabled`, true);
}
rwhSettings.setDefault(`${id}.enabled`, true);

// TODO revisit later on
// if (account.type === 'imap' || account.type === 'pop3') {
// rwhSettings.setDefault(`${id}.enabled`, true);
// }
});

messenger.accounts.onDeleted.addListener(async function (id) {
Expand Down
2 changes: 1 addition & 1 deletion modules/accounts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function findIdByIdentityId(identityId) {
}

export async function all() {
let accounts = await messenger.accounts.list();
let accounts = await messenger.accounts.list(false);
let res = [];
for (let account of accounts) {
if (account.type === 'none') { continue };
Expand Down

0 comments on commit 35145c9

Please sign in to comment.