fix logout error

This commit is contained in:
Roland Osborne 2025-03-28 13:31:27 -07:00
parent 7468e72f0a
commit 5d0f6638b1
4 changed files with 38 additions and 29 deletions

View File

@ -34,4 +34,7 @@ export const styles = StyleSheet.create({
color: Colors.label,
fontSize: 12,
},
status: {
height: 64,
},
});

View File

@ -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>
);
}

View File

@ -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 = {};

View File

@ -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 = {