ordering-ui-react-native 0.15.73 → 0.15.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.73",
3
+ "version": "0.15.74",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -7,8 +7,7 @@ import {
7
7
  WalletList,
8
8
  useLanguage,
9
9
  useUtils,
10
- useConfig,
11
- useSession
10
+ useConfig
12
11
  } from 'ordering-components/native'
13
12
 
14
13
  import {
@@ -32,6 +31,7 @@ const WalletsUI = (props: any) => {
32
31
  const {
33
32
  navigation,
34
33
  walletList,
34
+ userLoyaltyLevel,
35
35
  transactionsList,
36
36
  setWalletSelected,
37
37
  isWalletCashEnabled,
@@ -42,7 +42,6 @@ const WalletsUI = (props: any) => {
42
42
  } = props
43
43
 
44
44
  const [, t] = useLanguage()
45
- const [{ user }] = useSession()
46
45
  const theme = useTheme()
47
46
  const [{ parsePrice }] = useUtils()
48
47
  const [{ configs }] = useConfig()
@@ -66,7 +65,7 @@ const WalletsUI = (props: any) => {
66
65
 
67
66
  const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
68
67
 
69
- const loyaltyLevel = Object.keys(user?.loyalty_level ?? {}).length > 0 && user?.loyalty_level
68
+ const loyaltyLevel = Object.keys(userLoyaltyLevel.loyaltyLevel ?? {}).length > 0 && userLoyaltyLevel.loyaltyLevel
70
69
 
71
70
  const walletName: any = {
72
71
  cash: {
@@ -117,6 +116,7 @@ const WalletsUI = (props: any) => {
117
116
  />
118
117
 
119
118
  {!walletList.loading &&
119
+ !userLoyaltyLevel.loading &&
120
120
  !walletList.error &&
121
121
  walletList.wallets?.length > 0 &&
122
122
  (
@@ -239,7 +239,7 @@ const WalletsUI = (props: any) => {
239
239
  </>
240
240
  )}
241
241
 
242
- {walletList?.loading && (
242
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
243
243
  <>
244
244
  <View>
245
245
  <Placeholder Animation={Fade}>
@@ -263,7 +263,7 @@ const WalletsUI = (props: any) => {
263
263
  </>
264
264
  )}
265
265
 
266
- {!walletList?.loading && (walletList?.error || !walletList?.wallets?.length) && (
266
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
267
267
  <NotFoundSource
268
268
  content={walletList?.error
269
269
  ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')