fix for delayed rendering of offsync card status

This commit is contained in:
balzack 2023-05-07 23:21:13 -07:00
parent c9d0dca5b0
commit e5fdfefcb7
5 changed files with 8 additions and 8 deletions

View File

@ -186,7 +186,7 @@ export function useCardContext() {
} }
catch (err) { catch (err) {
console.log(err); console.log(err);
entry.offsync = true; entry.card.offsync = true;
await store.actions.setCardItemOffsync(guid, card.id); await store.actions.setCardItemOffsync(guid, card.id);
} }
} }

View File

@ -354,7 +354,7 @@ export function useConversationContext() {
else if (channelId) { else if (channelId) {
channel.actions.setTopicFlag(channelId, topicId); channel.actions.setTopicFlag(channelId, topicId);
} }
setTopicField(topicId, 'blocked', 1); setTopicField(topicId, 'blocked', true);
updateState({ topics: topics.current }); updateState({ topics: topics.current });
}, },
clearTopicFlag: async (topicId) => { clearTopicFlag: async (topicId) => {
@ -365,7 +365,7 @@ export function useConversationContext() {
else if (channelId) { else if (channelId) {
channel.actions.clearTopicFlag(channelId, topicId); channel.actions.clearTopicFlag(channelId, topicId);
} }
setTopicField(topicId, 'blocked', 0); setTopicField(topicId, 'blocked', false);
updateState({ topics: topics.current }); updateState({ topics: topics.current });
}, },
getTopicAssetUrl: (topicId, assetId) => { getTopicAssetUrl: (topicId, assetId) => {

View File

@ -180,8 +180,8 @@ export function useStoreContext() {
notifiedProfile: card.notified_profile, notifiedProfile: card.notified_profile,
notifiedArticle: card.notified_article, notifiedArticle: card.notified_article,
notifiedChannel: card.notified_channel, notifiedChannel: card.notified_channel,
offsync: card.offsync, offsync: card.offsync === 1,
blocked: card.blocked, blocked: card.blocked === 1,
})); }));
}, },

View File

@ -35,10 +35,10 @@ export function CardItem({ item, openContact, enableIce, call, message }) {
)} )}
</View> </View>
)} )}
{ item.status === 'connected' && item.offsync === 1 && ( { item.status === 'connected' && item.offsync && (
<View style={styles.offsync} /> <View style={styles.offsync} />
)} )}
{ item.status === 'connected' && item.offsync !== 1 && ( { item.status === 'connected' && !item.offsync && (
<View style={styles.connected} /> <View style={styles.connected} />
)} )}
{ item.status === 'requested' && ( { item.status === 'requested' && (

View File

@ -91,7 +91,7 @@ export function useConversation() {
} }
return -1; return -1;
}); });
const filtered = sorted.filter(item => !(item.blocked === 1)); const filtered = sorted.filter(item => !(item.blocked));
updateState({ hosted, loaded, logo, subject, topics: filtered, delayed: false }); updateState({ hosted, loaded, logo, subject, topics: filtered, delayed: false });