diff --git a/app/mobile/ios/Databag/Info.plist b/app/mobile/ios/Databag/Info.plist index ded82efc..879e8c36 100644 --- a/app/mobile/ios/Databag/Info.plist +++ b/app/mobile/ios/Databag/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.4 + 1.5 CFBundleSignature ???? CFBundleVersion diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index 573cfc71..fc0c2256 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -20,6 +20,7 @@ export function useAppContext() { loginTimestamp: null, disconnected: null, deviceToken: null, + loggingOut: false, }); const store = useContext(StoreContext); const account = useContext(AccountContext); @@ -108,6 +109,7 @@ export function useAppContext() { } }, logout: async () => { + updateState({ loggingOut: true }); try { await messaging().deleteToken(); const token = await messaging().getToken(); @@ -119,6 +121,7 @@ export function useAppContext() { } await clearSession(); await store.actions.clearSession(); + updateState({ loggingOut: false }); }, remove: async () => { await removeProfile(state.server, state.appToken); diff --git a/app/mobile/src/session/profile/Profile.jsx b/app/mobile/src/session/profile/Profile.jsx index 7ee75efa..42e77c05 100644 --- a/app/mobile/src/session/profile/Profile.jsx +++ b/app/mobile/src/session/profile/Profile.jsx @@ -1,5 +1,5 @@ import { useEffect, useContext } from 'react'; -import { KeyboardAvoidingView, Modal, Alert, TextInput, ScrollView, View, Switch, TouchableOpacity, Text } from 'react-native'; +import { ActivityIndicator, KeyboardAvoidingView, Modal, Alert, TextInput, ScrollView, View, Switch, TouchableOpacity, Text } from 'react-native'; import { styles } from './Profile.styled'; import { useProfile } from './useProfile.hook'; import Ionicons from '@expo/vector-icons/AntDesign'; @@ -21,9 +21,16 @@ export function Profile({ navigation }) { ), headerRight: () => ( - - - + <> + { state.loggingOut && ( + + )} + { !state.loggingOut && ( + + + + )} + ), }); } @@ -71,9 +78,14 @@ export function Profile({ navigation }) { { `${state.handle}@${state.node}` } - - - + { state.loggingOut && ( + + )} + { !state.loggingOut && ( + + + + )} diff --git a/app/mobile/src/session/profile/Profile.styled.js b/app/mobile/src/session/profile/Profile.styled.js index f08b2d2a..32d4125b 100644 --- a/app/mobile/src/session/profile/Profile.styled.js +++ b/app/mobile/src/session/profile/Profile.styled.js @@ -44,6 +44,7 @@ export const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'center', + height: 32, }, headerText: { paddingLeft: 16, diff --git a/app/mobile/src/session/profile/useProfile.hook.js b/app/mobile/src/session/profile/useProfile.hook.js index 583ddefc..041e40a5 100644 --- a/app/mobile/src/session/profile/useProfile.hook.js +++ b/app/mobile/src/session/profile/useProfile.hook.js @@ -14,6 +14,7 @@ export function useProfile() { showDelete: false, tabbed: null, confirmDelete: null, + logginOut: false, }); const app = useContext(AppContext); @@ -42,8 +43,8 @@ export function useProfile() { }, [profile]); useEffect(() => { - const { disconnected } = app.state; - updateState({ disconnected }); + const { disconnected, loggingOut } = app.state; + updateState({ disconnected, loggingOut }); }, [app]); const actions = {