Merge branch 'main' of https://github.com/balzack/databag into main

This commit is contained in:
Roland Osborne 2023-05-19 15:48:49 -07:00
commit 4a98edabbb
9 changed files with 19 additions and 18 deletions

View File

@ -85,9 +85,9 @@ From Your Browser:
### Other installation options ### Other installation options
Instruction for installing without a container on a Raspberry Pi Zero are [here](/doc/pizero.md). Instructions for installing without a container on a Raspberry Pi Zero are [here](/doc/pizero.md).
Instruction for installing without a container in AWS are [here](/doc/aws.md). Instructions for installing without a container in AWS are [here](/doc/aws.md).
## Audio and Video Calls ## Audio and Video Calls

View File

@ -622,7 +622,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.13; MARKETING_VERSION = 1.15;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
@ -656,7 +656,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.13; MARKETING_VERSION = 1.15;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",

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

@ -22,7 +22,7 @@ export function useCardIcon() {
if (status === 'pending' || status === 'requested') { if (status === 'pending' || status === 'requested') {
requested = true; requested = true;
} }
if (item.card?.offsync) { if (item.card?.offsync && status === 'connected') {
offsync = true; offsync = true;
} }
}); });

View File

@ -12,6 +12,7 @@ export function ContactHeader({ contact }) {
} }
export function ContactBody({ contact }) { export function ContactBody({ contact }) {
const { state, actions } = useContact(contact); const { state, actions } = useContact(contact);
const getStatusText = (status) => { const getStatusText = (status) => {
@ -198,6 +199,11 @@ export function ContactBody({ contact }) {
<TouchableOpacity style={styles.button} onPress={reportContact}> <TouchableOpacity style={styles.button} onPress={reportContact}>
<Text style={styles.buttonText}>Report Contact</Text> <Text style={styles.buttonText}>Report Contact</Text>
</TouchableOpacity> </TouchableOpacity>
{ state.offsync && (
<TouchableOpacity style={styles.alert} onPress={actions.resync}>
<Text>Resync Contact</Text>
</TouchableOpacity>
)}
</> </>
)} )}
{ state.status === 'connecting' && ( { state.status === 'connecting' && (
@ -286,11 +292,6 @@ export function ContactBody({ contact }) {
</TouchableOpacity> </TouchableOpacity>
</> </>
)} )}
{ state.offsync && (
<TouchableOpacity style={styles.alert} onPress={actions.resync}>
<Text style={styles.alertText}>Resync Contact</Text>
</TouchableOpacity>
)}
</View> </View>
</View> </View>
); );

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 });