diff --git a/net/web/src/context/useConversationContext.hook.js b/net/web/src/context/useConversationContext.hook.js index fa1b98a7..87560918 100644 --- a/net/web/src/context/useConversationContext.hook.js +++ b/net/web/src/context/useConversationContext.hook.js @@ -221,9 +221,6 @@ export function useConversationContext() { catch (err) { console.log(err); updateState({ error: true }); - if (ev.type === EVENT_RESYNC) { - window.alert("failed to syncrhonize conversation"); - } } } diff --git a/net/web/src/session/cards/cardItem/CardItem.jsx b/net/web/src/session/cards/cardItem/CardItem.jsx index 07656f8f..8d011b98 100644 --- a/net/web/src/session/cards/cardItem/CardItem.jsx +++ b/net/web/src/session/cards/cardItem/CardItem.jsx @@ -33,7 +33,12 @@ export function CardItem({ item, open }) {
{ handle() }
- { !state.resync && item.error && ( + { !state.resync && item.error && state.display === 'small' && ( + + + + )} + { !state.resync && item.error && state.display !== 'small' && ( diff --git a/net/web/src/session/cards/cardItem/useCardItem.hook.js b/net/web/src/session/cards/cardItem/useCardItem.hook.js index 2cbbbe04..83a4fc57 100644 --- a/net/web/src/session/cards/cardItem/useCardItem.hook.js +++ b/net/web/src/session/cards/cardItem/useCardItem.hook.js @@ -1,5 +1,6 @@ import { useContext, useState, useEffect } from 'react'; import { CardContext } from 'context/CardContext'; +import { ViewportContext } from 'context/ViewportContext'; export function useCardItem(item) { @@ -9,6 +10,7 @@ export function useCardItem(item) { }); const card = useContext(CardContext); + const viewport = useContext(ViewportContext); const updateState = (value) => { setState((s) => ({ ...s, ...value })); @@ -18,6 +20,10 @@ export function useCardItem(item) { updateState({ logo: card.actions.getImageUrl(item.id) }); }, [card, item]); + useEffect(() => { + updateState({ display: viewport.state.display }); + }, [viewport]); + const actions = { resync: async () => { if (!state.resync) { diff --git a/net/web/src/session/conversation/Conversation.jsx b/net/web/src/session/conversation/Conversation.jsx index ca7c5f0a..5b8efdd4 100644 --- a/net/web/src/session/conversation/Conversation.jsx +++ b/net/web/src/session/conversation/Conversation.jsx @@ -23,7 +23,12 @@ export function Conversation({ closeConversation, openDetails, cardId, channelId
{ state.subject }
- { state.error && ( + { state.error && state.display === 'small' && ( + + + + )} + { state.error && state.display !== 'small' && ( @@ -72,13 +77,22 @@ export function Conversation({ closeConversation, openDetails, cardId, channelId { state.uploadError && (
- + { state.display === 'small' && (
actions.clearUploadErrors(cardId, channelId)}>
-
+ )} + { state.display !== 'small' && ( + + +
actions.clearUploadErrors(cardId, channelId)}> + +
+
+
+ )}
)}