Commit 023c043a authored by Harrison Healey's avatar Harrison Healey Committed by Joram Wilander

Silence fetch errors caused by websocket action (#545) (#548)

parent b01fa20d
......@@ -312,7 +312,16 @@ async function handleNewPostEvent(msg, dispatch, getState) {
}
if (post.root_id && !posts[post.root_id]) {
await Client4.getPostThread(post.root_id).then((data) => {
let response;
try {
response = await Client4.getPostThread(post.root_id);
} catch (e) {
console.warn('failed to get thread for new post event', e); // eslint-disable-line no-console
}
if (response && response.data) {
const data = response.data;
const rootUserId = data.posts[post.root_id].user_id;
const rootStatus = users.statuses[rootUserId];
if (!users.profiles[rootUserId] && rootUserId !== currentUserId) {
......@@ -328,7 +337,7 @@ async function handleNewPostEvent(msg, dispatch, getState) {
data,
channelId: post.channel_id,
}, getState);
});
}
}
const actions = [{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment