Show debug log messages on triggering changes

This commit is contained in:
Eli Ribble 2024-08-28 10:16:40 -07:00
parent d6b675f7b6
commit bf1ad0326d
1 changed files with 6 additions and 5 deletions

View File

@ -106,7 +106,7 @@ export default class Client {
); );
} }
this.state.session.emails[e.id] = e; this.state.session.emails[e.id] = e;
this._triggerChange(); this._triggerChange("Email " + e.id);
}); });
}) })
.catch((x) => { .catch((x) => {
@ -125,7 +125,7 @@ export default class Client {
const mailbox = this.mailbox(accountId, mailboxId); const mailbox = this.mailbox(accountId, mailboxId);
if (mailbox == null) return; if (mailbox == null) return;
mailbox.emailIds = response.ids; mailbox.emailIds = response.ids;
this._triggerChange(); this._triggerChange("Email list " + mailboxId);
}) })
.catch(() => { .catch(() => {
console.error("Failed to get email list from mailbox", mailboxId); console.error("Failed to get email list from mailbox", mailboxId);
@ -165,11 +165,12 @@ export default class Client {
}); });
}); });
account.mailboxes = mailboxes; account.mailboxes = mailboxes;
this._triggerChange(); this._triggerChange("Mailboxes " + accountId);
}); });
} }
_triggerChange() { _triggerChange(msg: string) {
console.log("Client change", msg);
this.callbacks.forEach((c) => { this.callbacks.forEach((c) => {
c(); c();
}); });
@ -192,6 +193,6 @@ export default class Client {
emails: {}, emails: {},
}; };
if (!this.state.session) return; if (!this.state.session) return;
this._triggerChange(); this._triggerChange("Session");
} }
} }