Skip to content

Commit

Permalink
Merge pull request #977 from liquality/fix/account-filter-and-swap-cr…
Browse files Browse the repository at this point in the history
…eation

fix: fixed activity screen filters for current asset transactions
  • Loading branch information
bradleySuira authored Jan 9, 2023
2 parents f0dc6bf + 3f8df53 commit 0a7540d
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VUE_APP_FIREBASE_APP_ID=
VUE_APP_FIREBASE_MEASUREMENT_ID=
VUE_APP_FIREBASE_DATABASE_URL=
VUE_APP_MAX_ERROR_LOG_SIZE=100
VUE_APP_REPORT_TARGETS=Sentry
VUE_APP_REPORT_TARGETS=Sentry,Console
VUE_APP_NPM_PACKAGE_VERSION=0_81_0
VUE_APP_SENTRY_DSN=https://2c52b9d6e67741cf9d4eabe32369827a@o241807.ingest.sentry.io/5444900

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquality-wallet",
"version": "0.82.10",
"version": "0.82.11",
"private": true,
"author": "Liquality <info@liquality.io>",
"scripts": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"@liquality/ethereum-utils": "^1.13.12",
"@liquality/terra-networks": "^1.13.12",
"@liquality/types": "^1.13.12",
"@liquality/wallet-core": "4.3.0",
"@liquality/wallet-core": "4.4.0",
"@terra-money/terra.js": "^3.1.6",
"@testing-library/vue": "^5.8.2",
"amplitude-js": "8.18.2",
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Vue.config.productionTip = false
Vue.use(Localization)

new Vue({
name: 'Liquality Wallet',
router,
store,
render: (h) => h(App)
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.82.10",
"version": "0.82.11",
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
Expand Down
71 changes: 33 additions & 38 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import OpenWallet from '@/views/Open.vue'
import WalletAssets from '@/views/Wallet/WalletAssets.vue'
import Wallet from '@/views/Wallet/Wallet.vue'

const Warning = () =>
import(/* webpackPrefetch: true */ '@/views/Onboarding/SeedPhrase/Warning.vue')
const LoginPhrase = () =>
import(/* webpackPrefetch: true */ '@/views/Onboarding/SeedPhrase/LoginPhrase.vue')
const Warning = () => import('@/views/Onboarding/SeedPhrase/Warning.vue')
const LoginPhrase = () => import('@/views/Onboarding/SeedPhrase/LoginPhrase.vue')

Vue.use(VueRouter)

Expand All @@ -25,7 +23,7 @@ const routes = [
},
{
path: '/onboarding/import',
component: () => import(/* webpackPrefetch: true */ '@/views/Onboarding/ImportWallet.vue'),
component: () => import('@/views/Onboarding/ImportWallet.vue'),
meta: { protect: false }
},
{
Expand All @@ -36,14 +34,14 @@ const routes = [
},
{
path: '/onboarding/setup/:seedphrase?',
component: () => import(/* webpackPrefetch: true */ '@/views/Onboarding/OnboardingSetup.vue'),
component: () => import('@/views/Onboarding/OnboardingSetup.vue'),
name: 'OnboardingSetup',
props: true,
meta: { protect: false }
},
{
path: '/onboarding/home',
component: () => import(/* webpackPrefetch: true */ '@/views/Onboarding/OnboardingHome.vue'),
component: () => import('@/views/Onboarding/OnboardingHome.vue'),
name: 'OnboardingHome',
meta: { protect: false }
},
Expand All @@ -52,7 +50,7 @@ const routes = [
// Settings
{
path: '/settings',
component: () => import(/* webpackPrefetch: true */ '@/views/Settings'),
component: () => import('@/views/Settings'),
meta: { protect: true },
children: [
{
Expand All @@ -69,7 +67,7 @@ const routes = [
},
{
path: '/settings/experiments',
component: () => import(/* webpackPrefetch: true */ '@/views/Experiments'),
component: () => import('@/views/Experiments'),
name: 'Experiments',
meta: { protect: true }
},
Expand All @@ -81,7 +79,7 @@ const routes = [
},
{
path: '/settings/manage-assets/custom-token',
component: () => import(/* webpackPrefetch: true */ '@/views/CustomToken'),
component: () => import('@/views/CustomToken'),
name: 'CustomToken',
meta: { protect: true }
},
Expand All @@ -100,12 +98,12 @@ const routes = [
},
{
path: 'activity',
component: () => import(/* webpackPrefetch: true */ '@/views/Wallet/WalletActivity.vue'),
component: () => import('@/views/Wallet/WalletActivity.vue'),
name: 'WalletActivity'
},
{
path: 'nfts',
component: () => import(/* webpackPrefetch: true */ '@/views/Wallet/WalletNFTs.vue'),
component: () => import('@/views/Wallet/WalletNFTs.vue'),
name: 'WalletNFTs'
},
{
Expand All @@ -116,144 +114,142 @@ const routes = [
},
{
path: '/wallet/nfts/activity/:id',
component: () => import(/* webpackPrefetch: true */ '@/views/Wallet/NFTActivity.vue'),
component: () => import('@/views/Wallet/NFTActivity.vue'),
name: 'NFTActivity',
props: true
},
{
path: '/wallet/nfts/send',
component: () => import(/* webpackPrefetch: true */ '@/views/Send/SendNFT.vue'),
component: () => import('@/views/Send/SendNFT.vue'),
name: 'SendNFT'
},
{
path: '/details/nft-transaction/:id',
component: () =>
import(/* webpackPrefetch: true */ '@/views/Details/NFTTransactionDetails.vue'),
component: () => import('@/views/Details/NFTTransactionDetails.vue'),
name: 'NFTTransactionDetails',
props: true
},
// Details
{
path: '/details/swap/:id',
component: () => import(/* webpackPrefetch: true */ '@/views/Details/SwapDetails.vue'),
component: () => import('@/views/Details/SwapDetails.vue'),
name: 'SwapDetails',
props: true,
meta: { protect: true }
},
{
path: '/details/transaction/:id',
component: () => import(/* webpackPrefetch: true */ '@/views/Details/TransactionDetails.vue'),
component: () => import('@/views/Details/TransactionDetails.vue'),
name: 'TransactionDetails',
props: true,
meta: { protect: true }
},
{
path: '/details/nft-collection/:id',
component: () => import(/* webpackPrefetch: true */ '@/views/Details/NFTCollectionList.vue'),
component: () => import('@/views/Details/NFTCollectionList.vue'),
name: 'NFTCollectionList',
props: true
},
{
path: '/details/nft-asset/:id',
component: () => import(/* webpackPrefetch: true */ '@/views/Details/NFTAssetDetails.vue'),
component: () => import('@/views/Details/NFTAssetDetails.vue'),
name: 'NFTAssetDetails',
props: true
},

// Accounts
{
path: '/accounts/management',
component: () => import(/* webpackPrefetch: true */ '@/views/Accounts/Manage.vue'),
component: () => import('@/views/Accounts/Manage.vue'),
name: 'ManageAccounts',
props: true,
meta: { protect: true }
},
{
path: '/accounts/create/:chainId?',
component: () => import(/* webpackPrefetch: true */ '@/views/Accounts/Create.vue'),
component: () => import('@/views/Accounts/Create.vue'),
name: 'CreateAccount',
props: true,
meta: { protect: true }
},
{
path: '/accounts/hardware-wallet',
component: () =>
import(/* webpackPrefetch: true */ '@/views/Accounts/HardwareWallet/HardwareWallet.vue'),
component: () => import('@/views/Accounts/HardwareWallet/HardwareWallet.vue'),
props: true,
name: 'HardwareWallet',
meta: { protect: true }
},
{
name: 'Account',
path: '/accounts/:accountId/:asset',
component: () => import(/* webpackPrefetch: true */ '@/views/Account.vue'),
component: () => import('@/views/Account.vue'),
props: true,
meta: { protect: true }
},
{
name: 'Send',
path: '/accounts/:accountId/:asset/send',
component: () => import(/* webpackPrefetch: true */ '@/views/Send/Send.vue'),
component: () => import('@/views/Send/Send.vue'),
props: true,
meta: { protect: true }
},
{
name: 'Receive',
path: '/accounts/:accountId/:asset/receive',
component: () => import(/* webpackPrefetch: true */ '@/views/Receive.vue'),
component: () => import('@/views/Receive.vue'),
props: true,
meta: { protect: true }
},
{
name: 'Swap',
path: '/accounts/:accountId/:routeAsset/swap',
component: () => import(/* webpackPrefetch: true */ '@/views/Swap/Swap.vue'),
component: () => import('@/views/Swap/Swap.vue'),
props: true,
meta: { protect: true }
},

// Assets list
{
path: '/assets/:action',
component: () => import(/* webpackPrefetch: true */ '@/views/AssetList.vue'),
component: () => import('@/views/AssetList.vue'),
props: true,
meta: { protect: true }
},

// Injection
{
path: '/request-unlock',
component: () => import(/* webpackPrefetch: true */ '@/views/RequestUnlockWallet.vue'),
component: () => import('@/views/RequestUnlockWallet.vue'),
meta: { protect: false }
},
{
path: '/enable',
component: () => import(/* webpackPrefetch: true */ '@/views/Enable.vue'),
component: () => import('@/views/Enable.vue'),
meta: { protect: false }
},
{
path: '/permission/send',
component: () => import(/* webpackPrefetch: true */ '@/views/PermissionSend.vue'),
component: () => import('@/views/PermissionSend.vue'),
meta: { protect: false }
},
{
path: '/permission/terra',
component: () => import(/* webpackPrefetch: true */ '@/views/PermissionTerra.vue'),
component: () => import('@/views/PermissionTerra.vue'),
meta: { protect: false }
},
{
path: '/permission/sign',
component: () => import(/* webpackPrefetch: true */ '@/views/PermissionSign.vue'),
component: () => import('@/views/PermissionSign.vue'),
meta: { protect: false }
},
{
path: '/permission/signPsbt',
component: () => import(/* webpackPrefetch: true */ '@/views/PermissionSignPsbt.vue'),
component: () => import('@/views/PermissionSignPsbt.vue'),
meta: { protect: false }
},
{
path: '/permission/default',
component: () => import(/* webpackPrefetch: true */ '@/views/Permission.vue'),
component: () => import('@/views/Permission.vue'),
meta: { protect: false }
},
// Injection
Expand All @@ -271,8 +267,7 @@ const routes = [
},
{
path: '/seedreveal',
component: () =>
import(/* webpackPrefetch: true */ '@/views/Onboarding/SeedPhrase/PhraseReveal'),
component: () => import('@/views/Onboarding/SeedPhrase/PhraseReveal'),
meta: { protect: true }
},

Expand Down
12 changes: 9 additions & 3 deletions src/views/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ export default {
return this.marketData[this.activeNetwork][this.asset]
},
assetHistory() {
return this.activity.filter((item) => this.isNotNftTransaction(item))
return this.activity.filter((item) => {
return (
(item.from === this.asset || item.to === this.asset) && this.isNotNftTransaction(item)
)
})
},
addressLink() {
if (this.account) {
Expand All @@ -200,7 +204,9 @@ export default {
return cryptoassets[this.asset]?.chain
},
filteredTransactions() {
return this.activityData.filter((t) => t.accountId === this.accountId)
return this.activityData.filter(
(t) => t.fromAccountId === this.accountId || t.toAccountId === this.accountId
)
}
},
methods: {
Expand All @@ -212,7 +218,7 @@ export default {
formatFiat,
formatFiatUI,
isNotNftTransaction(item) {
return item.from === this.asset && item.type !== 'NFT'
return item.type !== 'NFT'
},
async copyAddress() {
await navigator.clipboard.writeText(this.address)
Expand Down
1 change: 0 additions & 1 deletion src/views/PermissionSend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ export default {
} else {
this.updateMaxSendFees()
this.updateSendFees(this.amount)
debugger
this.customFee = this.calculateFee(fee)
this.selectedFee = 'custom'
}
Expand Down
6 changes: 5 additions & 1 deletion src/views/Swap/Accounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default {
accounts() {
return (this.assetSelection === 'from' ? this.accountsWithBalance : this.accountsData)
.filter((acc) => {
if (isEvmChain(this.activeNetwork, this.account.chain) && this.assetSelection === 'to') {
if (
isEvmChain(this.activeNetwork, this.account.chain) && // from
isEvmChain(this.activeNetwork, acc.chain) && // to
this.assetSelection === 'to'
) {
return this.account.addresses[0] === acc.addresses[0]
}
return true
Expand Down
2 changes: 1 addition & 1 deletion src/views/UnlockWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default {
}
})
} catch (e) {
reportLiqualityError(e)
this.error = this.$tle(errorToLiqualityErrorString(e))
reportLiqualityError(e)
this.trackAnalytics({
event: 'UnlockWallet failed',
properties: {
Expand Down
Loading

0 comments on commit 0a7540d

Please sign in to comment.