From 0003694d55a7745617bc15e2dfd6e5b59bb10e2a Mon Sep 17 00:00:00 2001 From: noumantahir Date: Fri, 25 Feb 2022 00:12:06 +0500 Subject: [PATCH] fetching ecency user data with current account --- .../container/accountsBottomSheetContainer.tsx | 2 ++ .../application/container/applicationContainer.js | 9 +++++++++ src/screens/pinCode/container/pinCodeContainer.js | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/components/accountsBottomSheet/container/accountsBottomSheetContainer.tsx b/src/components/accountsBottomSheet/container/accountsBottomSheetContainer.tsx index 5cb318b26..13fe21c9b 100644 --- a/src/components/accountsBottomSheet/container/accountsBottomSheetContainer.tsx +++ b/src/components/accountsBottomSheet/container/accountsBottomSheetContainer.tsx @@ -25,6 +25,7 @@ import { useIntl } from 'react-intl'; import { useAppSelector } from '../../../hooks'; import { getUnreadNotificationCount } from '../../../providers/ecency/ecency'; import { decryptKey } from '../../../utils/crypto'; +import { getUser as getEcencyUser} from '../../../providers/ecency/ePoint'; const AccountsBottomSheetContainer = ({ navigation }) => { const intl = useIntl(); @@ -106,6 +107,7 @@ const AccountsBottomSheetContainer = ({ navigation }) => { decryptKey(encryptedAccessToken, getDigitPinCode(pinHash)) ); _currentAccount.mutes = await getMutes(_currentAccount.username); + _currentAccount.ecencyUserData = await getEcencyUser(_currentAccount.username); dispatch(updateCurrentAccount(_currentAccount)); } diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index f40815d5a..7abb2d4f0 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -41,6 +41,7 @@ import { setLastUpdateCheck, } from '../../../realm/realm'; import { getUser, getPost, getDigitPinCode, getMutes } from '../../../providers/hive/dhive'; +import { getUser as getEcencyUser } from '../../../providers/ecency/ePoint'; import { migrateToMasterKeyWithAccessToken, refreshSCToken, @@ -51,6 +52,7 @@ import { markActivityAsRead, markNotifications, getUnreadNotificationCount, + getLatestQuotes, } from '../../../providers/ecency/ecency'; import { fetchLatestAppVersion } from '../../../providers/github/github'; import { navigate } from '../../../navigation/service'; @@ -95,6 +97,7 @@ import { updateActiveBottomTab, } from '../../../redux/actions/uiAction'; import { setFeedPosts, setInitPosts } from '../../../redux/actions/postsAction'; +import { fetchCoinQuotes, resetWalletData } from '../../../redux/actions/walletActions'; import { encryptKey } from '../../../utils/crypto'; @@ -139,6 +142,8 @@ class ApplicationContainer extends Component { const { appVersion } = VersionNumber; const { dispatch, isAnalytics } = this.props; + dispatch(resetWalletData()); + this._setNetworkListener(); Linking.addEventListener('url', this._handleOpenURL); @@ -619,6 +624,7 @@ class ApplicationContainer extends Component { _refreshGlobalProps = () => { const { actions } = this.props; actions.fetchGlobalProperties(); + actions.fetchCoinQuotes(); }; _getUserDataFromRealm = async () => { @@ -759,6 +765,7 @@ class ApplicationContainer extends Component { accountData.unread_activity_count = await getUnreadNotificationCount(); accountData.mutes = await getMutes(realmObject.username); + accountData.ecencyUserData = await getEcencyUser(realmObject.username); dispatch(updateCurrentAccount(accountData)); this._connectNotificationServer(accountData.name); @@ -941,6 +948,7 @@ class ApplicationContainer extends Component { _currentAccount.unread_activity_count = await getUnreadNotificationCount(); _currentAccount.mutes = await getMutes(_currentAccount.username); + _currentAccount.ecencyUserData = await getEcencyUser(_currentAccount.username); dispatch(updateCurrentAccount(_currentAccount)); }; @@ -1068,6 +1076,7 @@ export default connect( ...bindActionCreators( { fetchGlobalProperties, + fetchCoinQuotes, }, dispatch, ), diff --git a/src/screens/pinCode/container/pinCodeContainer.js b/src/screens/pinCode/container/pinCodeContainer.js index fdec69ee2..cd61f524b 100644 --- a/src/screens/pinCode/container/pinCodeContainer.js +++ b/src/screens/pinCode/container/pinCodeContainer.js @@ -36,6 +36,7 @@ import { } from '../../../realm/realm'; import { updateCurrentAccount, removeOtherAccount } from '../../../redux/actions/accountAction'; import { getDigitPinCode, getMutes, getUser } from '../../../providers/hive/dhive'; +import { getUser as getEcencyUser } from '../../../providers/ecency/ePoint'; // Utils import { encryptKey, decryptKey } from '../../../utils/crypto'; @@ -319,6 +320,7 @@ class PinCodeContainer extends Component { //get unread notifications _currentAccount.unread_activity_count = await getUnreadNotificationCount(); _currentAccount.mutes = await getMutes(_currentAccount.username); + _currentAccount.ecencyUserData = await getEcencyUser(_currentAccount.username); dispatch(updateCurrentAccount({ ..._currentAccount })); dispatch(closePinCodeModal()); }