fix flickering in channel list

This commit is contained in:
Roland Osborne 2022-09-20 12:05:32 -07:00
parent 398e118c45
commit 61cb4fc903
4 changed files with 34 additions and 5 deletions

View File

@ -64,7 +64,6 @@ export function useChannelContext() {
const { server, appToken, guid } = session.current;
const delta = await getChannels(server, appToken, setRevision.current);
console.log(delta);
for (let channel of delta) {
if (channel.data) {
if (channel.data.channelDetail && channel.data.channelSummary) {
@ -139,7 +138,6 @@ console.log(delta);
updateState({ account: null, channels: channels.current });
},
setRevision: (rev) => {
console.log("CHANNEL REVISION:", rev);
curRevision.current = rev;
sync();
},

View File

@ -0,0 +1,28 @@
import { StyleSheet } from 'react-native';
import { Colors } from 'constants/Colors';
export const styles = StyleSheet.create({
container: {
width: '100%',
display: 'flex',
flexDirection: 'row',
height: 48,
alignItems: 'center',
borderBottomWidth: 1,
borderColor: Colors.itemDivider,
},
detail: {
paddingLeft: 12,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
flexGrow: 1,
flexShrink: 1,
},
subject: {
},
message: {
color: Colors.disabled,
},
})

View File

@ -67,7 +67,12 @@ export function useChannels() {
if (contacts.length) {
let names = [];
for (let contact of contacts) {
names.push(contact?.profile?.handle);
if (contact?.profile?.name) {
names.push(contact.profile.name);
}
else {
names.push(contact?.profile?.handle);
}
}
subject = names.join(', ');
}

View File

@ -1,7 +1,6 @@
import { useState, useEffect, useContext } from 'react';
import { useWindowDimensions } from 'react-native';
import { useNavigate } from 'react-router-dom';
import { AppContext } from 'context/AppContext';
import config from 'constants/Config';
export function useSession() {
@ -14,7 +13,6 @@ export function useSession() {
converstaionId: null,
});
const dimensions = useWindowDimensions();
const app = useContext(AppContext);
const navigate = useNavigate();
const updateState = (value) => {