mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
fix flickering in channel list
This commit is contained in:
parent
398e118c45
commit
61cb4fc903
@ -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();
|
||||
},
|
||||
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
@ -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(', ');
|
||||
}
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user