mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fix for reset on orientation change
This commit is contained in:
parent
d21d7de58a
commit
b4b144383c
@ -34,20 +34,14 @@ const CardDrawer = createDrawerNavigator();
|
||||
const RegistryDrawer = createDrawerNavigator();
|
||||
const Tab = createBottomTabNavigator();
|
||||
|
||||
export function Session() {
|
||||
|
||||
const { state, actions } = useSession();
|
||||
|
||||
const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' };
|
||||
function ConversationStackScreen() {
|
||||
const stackParams = { headerStyle: { backgroundColor: Colors.titleBackground }, headerBackTitleVisible: false };
|
||||
const screenParams = { headerShown: true, headerTintColor: Colors.primary };
|
||||
|
||||
const ConversationStackScreen = () => {
|
||||
const conversation = useContext(ConversationContext);
|
||||
const [cardId, setCardId] = useState();
|
||||
const [channelId, setChannelId] = useState();
|
||||
|
||||
console.log("REnDER CONVERSATION STACK");
|
||||
const openConversation = (navigation, card, channel) => {
|
||||
(async () => {
|
||||
conversation.actions.setConversation(card, channel);
|
||||
@ -95,7 +89,10 @@ console.log("REnDER CONVERSATION STACK");
|
||||
);
|
||||
}
|
||||
|
||||
const ProfileStackScreen = () => {
|
||||
function ProfileStackScreen() {
|
||||
const stackParams = { headerStyle: { backgroundColor: Colors.titleBackground }, headerBackTitleVisible: false };
|
||||
const screenParams = { headerShown: true, headerTintColor: Colors.primary };
|
||||
|
||||
return (
|
||||
<SafeAreaView edges={['left', 'right']} style={styles.body}>
|
||||
<ProfileStack.Navigator screenOptions={({ route }) => (screenParams)}>
|
||||
@ -107,7 +104,10 @@ console.log("REnDER CONVERSATION STACK");
|
||||
);
|
||||
}
|
||||
|
||||
const ContactStackScreen = () => {
|
||||
function ContactStackScreen() {
|
||||
const stackParams = { headerStyle: { backgroundColor: Colors.titleBackground }, headerBackTitleVisible: false };
|
||||
const screenParams = { headerShown: true, headerTintColor: Colors.primary };
|
||||
|
||||
const profile = useContext(ProfileContext);
|
||||
|
||||
const [contact, setContact] = useState(null);
|
||||
@ -157,6 +157,12 @@ console.log("REnDER CONVERSATION STACK");
|
||||
);
|
||||
}
|
||||
|
||||
export function Session() {
|
||||
|
||||
const { state, actions } = useSession();
|
||||
|
||||
const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' };
|
||||
|
||||
const HomeScreen = ({ navParams }) => {
|
||||
|
||||
const conversation = useContext(ConversationContext);
|
||||
@ -304,8 +310,6 @@ console.log("REnDER CONVERSATION STACK");
|
||||
);
|
||||
}
|
||||
|
||||
console.log("RENDER ROOT", state.tabbed);
|
||||
|
||||
return (
|
||||
<NavigationContainer>
|
||||
<View style={styles.body}>
|
||||
|
@ -49,7 +49,6 @@ export function Conversation({ navigation, cardId, channelId, closeConversation,
|
||||
}, [navigation, state.subject, state.loaded]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("RESET CONVERSATION!");
|
||||
return () => { closeConversation(); };
|
||||
}, []);
|
||||
|
||||
|
@ -38,12 +38,10 @@ export function useSession() {
|
||||
if (dimensions.width > config.tabbedWidth) {
|
||||
const width = Math.floor((dimensions.width * 33) / 100);
|
||||
tabbed.current = false;
|
||||
console.log("SET TABBED: false");
|
||||
updateState({ tabbed: false, baseWidth: width + 50, subWidth: width });
|
||||
}
|
||||
else {
|
||||
tabbed.current = true;
|
||||
console.log("SET TABBED: true");
|
||||
updateState({ tabbed: true });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user