mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fixing flicker on contact drawer
This commit is contained in:
parent
7c9b811ca6
commit
b3828891af
@ -254,7 +254,9 @@ function CardDrawerScreen({ navParams }) {
|
|||||||
const [dmChannel, setDmChannel] = useState(null);
|
const [dmChannel, setDmChannel] = useState(null);
|
||||||
const openContact = (contact) => {
|
const openContact = (contact) => {
|
||||||
navParams.setContact(contact);
|
navParams.setContact(contact);
|
||||||
|
setTimeout(() => {
|
||||||
navParams.contactNav.openDrawer();
|
navParams.contactNav.openDrawer();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const openRegistry = () => {
|
const openRegistry = () => {
|
||||||
navParams.registryNav.openDrawer();
|
navParams.registryNav.openDrawer();
|
||||||
@ -277,7 +279,9 @@ function RegistryDrawerScreen({ navParams }) {
|
|||||||
const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' };
|
const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' };
|
||||||
const openContact = (contact) => {
|
const openContact = (contact) => {
|
||||||
navParams.setContact(contact);
|
navParams.setContact(contact);
|
||||||
|
setTimeout(() => {
|
||||||
navParams.contactNav.openDrawer();
|
navParams.contactNav.openDrawer();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -42,7 +42,7 @@ export function Contact({ contact, drawer, back }) {
|
|||||||
if (!busy) {
|
if (!busy) {
|
||||||
try {
|
try {
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
await new Promise(r => setTimeout(r, 100));
|
await new Promise(r => setTimeout(r, 200));
|
||||||
await action();
|
await action();
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
@ -62,9 +62,6 @@ export function Contact({ contact, drawer, back }) {
|
|||||||
{ drawer && (
|
{ drawer && (
|
||||||
<View style={styles.drawerContainer}>
|
<View style={styles.drawerContainer}>
|
||||||
<Text style={styles.drawerHeader} adjustsFontSizeToFit={true} numberOfLines={1}>{ state.username }</Text>
|
<Text style={styles.drawerHeader} adjustsFontSizeToFit={true} numberOfLines={1}>{ state.username }</Text>
|
||||||
<View style={styles.drawerFrame}>
|
|
||||||
<Image source={state.imageSource} style={styles.drawerLogo} resizeMode={'contain'} />
|
|
||||||
</View>
|
|
||||||
<View style={styles.drawerStatus}>
|
<View style={styles.drawerStatus}>
|
||||||
{ state.status === 'offsync' && (
|
{ state.status === 'offsync' && (
|
||||||
<View style={styles.statusOffsync}>
|
<View style={styles.statusOffsync}>
|
||||||
@ -107,6 +104,9 @@ export function Contact({ contact, drawer, back }) {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
<View style={styles.drawerFrame}>
|
||||||
|
<Image source={state.imageSource} style={styles.drawerLogo} resizeMode={'contain'} />
|
||||||
|
</View>
|
||||||
<View style={styles.drawerName}>
|
<View style={styles.drawerName}>
|
||||||
{ state.name && (
|
{ state.name && (
|
||||||
<Text style={styles.drawerNameSet} numberOfLines={1} adjustsFontSizeToFit={true}>{ state.name }</Text>
|
<Text style={styles.drawerNameSet} numberOfLines={1} adjustsFontSizeToFit={true}>{ state.name }</Text>
|
||||||
@ -140,7 +140,7 @@ export function Contact({ contact, drawer, back }) {
|
|||||||
{ !busy && (
|
{ !busy && (
|
||||||
<View style={styles.drawerActions}>
|
<View style={styles.drawerActions}>
|
||||||
{ state.status === 'offsync' && (
|
{ state.status === 'offsync' && (
|
||||||
<TouchableOpacity style={styles.action} activeOpacity={1} onPress={actions.resync}>
|
<TouchableOpacity style={styles.action} activeOpacity={1} onPress={() => setAction(actions.resync)}>
|
||||||
<MatIcons name="sync" style={styles.actionIcon} size={44} color={Colors.linkText} />
|
<MatIcons name="sync" style={styles.actionIcon} size={44} color={Colors.linkText} />
|
||||||
<Text style={styles.actionLabel}>{ state.strings.actionResync }</Text>
|
<Text style={styles.actionLabel}>{ state.strings.actionResync }</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@ -325,7 +325,7 @@ export function Contact({ contact, drawer, back }) {
|
|||||||
{ !busy && (
|
{ !busy && (
|
||||||
<ScrollView horizontal={true} contentContainerStyle={styles.actionList}>
|
<ScrollView horizontal={true} contentContainerStyle={styles.actionList}>
|
||||||
{ state.status === 'offsync' && (
|
{ state.status === 'offsync' && (
|
||||||
<TouchableOpacity style={styles.action} activeOpacity={1} onPress={actions.resync}>
|
<TouchableOpacity style={styles.action} activeOpacity={1} onPress={() => setAction(actions.resync)}>
|
||||||
<MatIcons name="sync" style={styles.actionIcon} size={40} color={Colors.linkText} />
|
<MatIcons name="sync" style={styles.actionIcon} size={40} color={Colors.linkText} />
|
||||||
<Text style={styles.actionLabel}>{ state.strings.actionResync }</Text>
|
<Text style={styles.actionLabel}>{ state.strings.actionResync }</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
Loading…
Reference in New Issue
Block a user