From bf1ad0326d006f464e4150580009f5f9c47f2af4 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 28 Aug 2024 10:16:40 -0700 Subject: [PATCH] Show debug log messages on triggering changes --- src/client/Client.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/Client.tsx b/src/client/Client.tsx index fde5d63..e96c6e8 100644 --- a/src/client/Client.tsx +++ b/src/client/Client.tsx @@ -106,7 +106,7 @@ export default class Client { ); } this.state.session.emails[e.id] = e; - this._triggerChange(); + this._triggerChange("Email " + e.id); }); }) .catch((x) => { @@ -125,7 +125,7 @@ export default class Client { const mailbox = this.mailbox(accountId, mailboxId); if (mailbox == null) return; mailbox.emailIds = response.ids; - this._triggerChange(); + this._triggerChange("Email list " + mailboxId); }) .catch(() => { console.error("Failed to get email list from mailbox", mailboxId); @@ -165,11 +165,12 @@ export default class Client { }); }); account.mailboxes = mailboxes; - this._triggerChange(); + this._triggerChange("Mailboxes " + accountId); }); } - _triggerChange() { + _triggerChange(msg: string) { + console.log("Client change", msg); this.callbacks.forEach((c) => { c(); }); @@ -192,6 +193,6 @@ export default class Client { emails: {}, }; if (!this.state.session) return; - this._triggerChange(); + this._triggerChange("Session"); } }