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, color: Colors.label,
fontSize: 12, fontSize: 12,
}, },
status: {
height: 64,
},
}); });

View File

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

View File

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

View File

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