diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-25 17:16:32 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-25 17:16:32 -0500 |
| commit | 2d2f0f67716a61b5044ce8499bf82c8554fbe360 (patch) | |
| tree | 7564351bd38c61aa4350ef648b82a80f9e80160a | |
| parent | 7e00ec468938b563460df76efa9dd239f2d2cceb (diff) | |
| download | slskd-2d2f0f67716a61b5044ce8499bf82c8554fbe360.tar.gz | |
trap errors fetching conversations
| -rw-r--r-- | src/web/src/components/Chat/Chat.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/web/src/components/Chat/Chat.jsx b/src/web/src/components/Chat/Chat.jsx index 9224fb30..4fcb44ed 100644 --- a/src/web/src/components/Chat/Chat.jsx +++ b/src/web/src/components/Chat/Chat.jsx @@ -60,7 +60,13 @@ class Chat extends Component { this.setState( { active: sessionStorage.getItem(activeChatKey) || '', - interval: window.setInterval(this.fetchConversations, 5_000), + interval: window.setInterval(async () => { + try { + await this.fetchConversations(); + } catch (error) { + console.error(error); + } + }, 5_000), }, async () => { await this.fetchConversations(); @@ -113,7 +119,6 @@ class Chat extends Component { // check to see if the active chat is still active // this will happen whenever a chat is closed/removed if (activeConversation) { - console.log('active?', activeConversation); // *before* fetching messages, ack any unacked messages // for the active chat if (activeConversation.hasUnAcknowledgedMessages === true) { |
