mirror of
https://github.com/balzack/databag.git
synced 2025-04-22 09:35:16 +00:00
fix logout error
This commit is contained in:
parent
7468e72f0a
commit
5d0f6638b1
@ -34,4 +34,7 @@ export const styles = StyleSheet.create({
|
||||
color: Colors.label,
|
||||
fontSize: 12,
|
||||
},
|
||||
status: {
|
||||
height: 64,
|
||||
},
|
||||
});
|
||||
|
@ -16,15 +16,17 @@ export function Base() {
|
||||
<Text style={styles.title}>Databag</Text>
|
||||
<Text style={styles.description}>{state.strings.communication}</Text>
|
||||
<Image style={styles.image} source={theme.colors.name === 'light' ? light : dark} resizeMode="contain" />
|
||||
{(state.profileSet === false || state.cardSet === false || state.channelSet === false) && (
|
||||
<View style={styles.steps}>
|
||||
{state.profileSet === false && <Text style={styles.step}>{state.strings.setupProfile}</Text>}
|
||||
<Icon size={14} source="chevron-right" color={Colors.placeholder} />
|
||||
{(state.profileSet === false || state.cardSet === false) && <Text style={styles.step}>{state.strings.connectPeople}</Text>}
|
||||
<Icon size={14} source="chevron-right" color={Colors.placeholder} />
|
||||
<Text style={styles.step}>{state.strings.startConversation}</Text>
|
||||
</View>
|
||||
)}
|
||||
<View style={styles.status}>
|
||||
{(state.profileSet === false || state.cardSet === false || state.channelSet === false) && (
|
||||
<View style={styles.steps}>
|
||||
{state.profileSet === false && <Text style={styles.step}>{state.strings.setupProfile}</Text>}
|
||||
<Icon size={14} source="chevron-right" color={Colors.placeholder} />
|
||||
{(state.profileSet === false || state.cardSet === false) && <Text style={styles.step}>{state.strings.connectPeople}</Text>}
|
||||
<Icon size={14} source="chevron-right" color={Colors.placeholder} />
|
||||
<Text style={styles.step}>{state.strings.startConversation}</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -28,16 +28,18 @@ export function useBase() {
|
||||
updateState({channelSet: cardId && channels.length > 0});
|
||||
};
|
||||
|
||||
const {identity, contact, content} = app.state.session;
|
||||
identity.addProfileListener(setProfile);
|
||||
contact.addCardListener(setCards);
|
||||
content.addChannelListener(setChannels);
|
||||
if (app.state.session) {
|
||||
const {identity, contact, content} = app.state.session;
|
||||
identity.addProfileListener(setProfile);
|
||||
contact.addCardListener(setCards);
|
||||
content.addChannelListener(setChannels);
|
||||
|
||||
return () => {
|
||||
identity.removeProfileListener(setProfile);
|
||||
contact.removeCardListener(setCards);
|
||||
content.removeChannelListener(setChannels);
|
||||
};
|
||||
return () => {
|
||||
identity.removeProfileListener(setProfile);
|
||||
contact.removeCardListener(setCards);
|
||||
content.removeChannelListener(setChannels);
|
||||
};
|
||||
}
|
||||
}, [app.state.session]);
|
||||
|
||||
const actions = {};
|
||||
|
@ -218,18 +218,20 @@ export function useContent() {
|
||||
updateState({sorted});
|
||||
};
|
||||
|
||||
const {identity, contact, content, settings} = app.state.session;
|
||||
identity.addProfileListener(setProfile);
|
||||
contact.addCardListener(setCards);
|
||||
content.addChannelListener(setChannels);
|
||||
settings.addConfigListener(setConfig);
|
||||
if (app.state.session) {
|
||||
const {identity, contact, content, settings} = app.state.session;
|
||||
identity.addProfileListener(setProfile);
|
||||
contact.addCardListener(setCards);
|
||||
content.addChannelListener(setChannels);
|
||||
settings.addConfigListener(setConfig);
|
||||
|
||||
return () => {
|
||||
identity.removeProfileListener(setProfile);
|
||||
contact.removeCardListener(setCards);
|
||||
content.removeChannelListener(setChannels);
|
||||
settings.removeConfigListener(setConfig);
|
||||
};
|
||||
return () => {
|
||||
identity.removeProfileListener(setProfile);
|
||||
contact.removeCardListener(setCards);
|
||||
content.removeChannelListener(setChannels);
|
||||
settings.removeConfigListener(setConfig);
|
||||
};
|
||||
}
|
||||
}, [app.state.session]);
|
||||
|
||||
const actions = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user