diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index 432bcf40e..e7aef4973 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -88,7 +88,8 @@ "schedules": "Schedules", "gallery": "Gallery", "settings": "Settings", - "add_account": "Add Account" + "add_account": "Add Account", + "logout": "Logout" }, "header": { "title": "Login to customize your feed", diff --git a/src/config/locales/tr-TR.json b/src/config/locales/tr-TR.json index a44b3a37f..63819a4ac 100644 --- a/src/config/locales/tr-TR.json +++ b/src/config/locales/tr-TR.json @@ -88,7 +88,8 @@ "schedules": "Yapılacaklar", "gallery": "Galeri", "settings": "Ayarlar", - "add_account": "Hesap Ekle" + "add_account": "Hesap Ekle", + "logout": "Cıkış" }, "header": { "title": "Giriş yap ve akışını özelleştir.", diff --git a/src/constants/routeNames.js b/src/constants/routeNames.js index bf89a76f5..b4f7371c5 100644 --- a/src/constants/routeNames.js +++ b/src/constants/routeNames.js @@ -1,6 +1,7 @@ const SCREEN_SUFFIX = 'Screen'; const DRAWER_SUFFIX = 'Drawer'; const TABBAR_SUFFIX = 'Tabbar'; +const MODAL_SUFFIX = 'Modal'; export default { SCREENS: { @@ -25,4 +26,7 @@ export default { MESSAGES: `Messages${TABBAR_SUFFIX}`, PROFILE: `Profile${TABBAR_SUFFIX}`, }, + MODAL: { + LOGOUT: `Logout${MODAL_SUFFIX}`, + }, }; diff --git a/src/constants/sideMenuItems.js b/src/constants/sideMenuItems.js index c703ff317..6b7585256 100644 --- a/src/constants/sideMenuItems.js +++ b/src/constants/sideMenuItems.js @@ -43,6 +43,12 @@ const authMenuItems = [ icon: 'gear', id: 'settings', }, + { + name: 'Logout', + route: ROUTES.MODAL.LOGOUT, + icon: 'sign-out', + id: 'logout', + }, ]; const noAuthMenuItems = [ diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index b55d89b6f..595c6b608 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -110,7 +110,7 @@ class ApplicationContainer extends Component { dispatch(login()); const realmObject = realmData.filter(data => data.username === currentUsername); - accountData.local = realmObject; + accountData.local = realmObject[0]; dispatch(updateCurrentAccount(accountData)); // If in dev mode pin code does not show diff --git a/src/screens/pinCode/container/pinCodeContainer.js b/src/screens/pinCode/container/pinCodeContainer.js index accb8acc0..26af5d17c 100644 --- a/src/screens/pinCode/container/pinCodeContainer.js +++ b/src/screens/pinCode/container/pinCodeContainer.js @@ -8,7 +8,10 @@ import { setUserDataWithPinCode, verifyPinCode } from '../../../providers/steem/ // Actions & Services import { closePinCodeModal } from '../../../redux/actions/applicationActions'; import { - getExistUser, setExistUser, getUserData, getUserDataWithUsername, + getExistUser, + setExistUser, + getUserData, + getUserDataWithUsername, } from '../../../realm/realm'; import { updateCurrentAccount } from '../../../redux/actions/accountAction'; import { formatAccount } from '../../../utils/user'; @@ -113,7 +116,7 @@ class PinCodeContainer extends Component { }; setUserDataWithPinCode(pinData).then((response) => { const _currentAccount = currentAccount; - _currentAccount.local = response; + _currentAccount.local = response[0]; dispatch(updateCurrentAccount({ ..._currentAccount }));