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