diff --git a/app/mobile/src/access/login/useLogin.hook.js b/app/mobile/src/access/login/useLogin.hook.js index 6a938bb6..9f93d14a 100644 --- a/app/mobile/src/access/login/useLogin.hook.js +++ b/app/mobile/src/access/login/useLogin.hook.js @@ -31,10 +31,10 @@ export function useLogin() { }, [app.state.session]); useEffect(() => { - if (state.password && state.login && !state.enabled && state.login.includes('@')) { + if (state.password && state.login && !state.enabled && (state.login.includes('@') || state.login.includes('/'))) { updateState({ enabled: true }); } - if ((!state.password || !state.login || !state.login.includes('@')) && state.enabled) { + if ((!state.password || !state.login || (!state.login.includes('@') && !state.login.includes('/'))) && state.enabled) { updateState({ enabled: false }); } }, [state.login, state.password]); diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index f697fdaf..afc4c7aa 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -120,7 +120,7 @@ export function useAppContext() { throw new Error('invalid session state'); } updateState({ loggedOut: false }); - const acc = username.split('@'); + const acc = username.includes('/') ? username.split('/') : username.split('@'); const session = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, notifications) access.current = { loginTimestamp: session.created, server: acc[1], token: session.appToken, guid: session.guid }; await store.actions.setSession(access.current); diff --git a/app/mobile/src/session/cards/Cards.jsx b/app/mobile/src/session/cards/Cards.jsx index 47cccd5f..9344a32c 100644 --- a/app/mobile/src/session/cards/Cards.jsx +++ b/app/mobile/src/session/cards/Cards.jsx @@ -57,6 +57,29 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) { return ( + + { state.sort && ( + actions.setSort(false)}> + + + )} + { !state.sort && ( + actions.setSort(true)}> + + + )} + + + + + + openRegistry(navigation)}> + + { state.strings.add } + + + { state.cards.length == 0 && ( { state.strings.noContacts } diff --git a/app/mobile/src/session/cards/useCards.hook.js b/app/mobile/src/session/cards/useCards.hook.js index 9bcb6855..02ec46f3 100644 --- a/app/mobile/src/session/cards/useCards.hook.js +++ b/app/mobile/src/session/cards/useCards.hook.js @@ -5,7 +5,7 @@ import { AccountContext } from 'context/AccountContext'; import { ProfileContext } from 'context/ProfileContext'; import { getLanguageStrings } from 'constants/Strings'; -export function useCards(filter, sort) { +export function useCards() { const [state, setState] = useState({ cards: [], @@ -58,10 +58,10 @@ export function useCards(filter, sort) { if (item.blocked) { return false; } - if (!filter) { + if (!state.filter) { return true; } - const lower = filter.toLowerCase(); + const lower = state.filter.toLowerCase(); if (item.name) { if (item.name.toLowerCase().includes(lower)) { return true; @@ -74,7 +74,7 @@ export function useCards(filter, sort) { } return false; }) - if (sort) { + if (state.sort) { filtered.sort((a, b) => { const aName = a?.name?.toLowerCase(); const bName = b?.name?.toLowerCase(); @@ -99,7 +99,7 @@ export function useCards(filter, sort) { }); } updateState({ cards: filtered }); - }, [card, filter, sort]); + }, [card, state.filter, state.sort]); const actions = { call: async (card) => { diff --git a/app/mobile/src/session/profile/Profile.styled.js b/app/mobile/src/session/profile/Profile.styled.js index bc963f5f..c86369c9 100644 --- a/app/mobile/src/session/profile/Profile.styled.js +++ b/app/mobile/src/session/profile/Profile.styled.js @@ -369,6 +369,7 @@ export const styles = StyleSheet.create({ height: 32, display: 'flex', alignItems: 'center', + justifyContent: 'center', }, cancelButtonText: { color: Colors.cancelButtonText, @@ -386,6 +387,7 @@ export const styles = StyleSheet.create({ height: 32, display: 'flex', alignItems: 'center', + justifyContent: 'center', }, saveButtonText: { color: Colors.primaryButtonText,