Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove getAssets from select-token dialog #123

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/components/SelectToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ export default class SelectToken extends Mixins(TranslationMixin, DialogMixin, L
@Getter('assets', { namespace }) assets!: Array<Asset>
@Getter accountAssets!: Array<AccountAsset> // Wallet store

@Action('getAssets', { namespace }) getAssets

created (): void {
this.withApi(this.getAssets)
}

get accountAssetsHashTable () {
return this.accountAssets.reduce((result, item) => ({
...result,
Expand Down
2 changes: 2 additions & 0 deletions src/components/mixins/TokenPairMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const CreateTokenPairMixin = (namespace: string) => {
@Action('getNetworkFee', { namespace }) getNetworkFee
@Action('getPrices', { namespace: 'prices' }) getPrices
@Action('resetPrices', { namespace: 'prices' }) resetPrices
@Action('getAssets', { namespace: 'assets' }) getAssets

showSelectFirstTokenDialog = false
showSelectSecondTokenDialog = false
Expand All @@ -48,6 +49,7 @@ const CreateTokenPairMixin = (namespace: string) => {
await this.withApi(async () => {
this.resetPrices()
this.resetData()
await this.getAssets()
this.setFirstTokenAddress(KnownAssets.get(KnownSymbols.XOR).address)
await this.afterApiConnect()
})
Expand Down
4 changes: 3 additions & 1 deletion src/views/Swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export default class Swap extends Mixins(TranslationMixin, LoadingMixin, NumberF

@Action('getPrices', { namespace: 'prices' }) getPrices!: (options: any) => Promise<void>
@Action('resetPrices', { namespace: 'prices' }) resetPrices!: () => Promise<void>
@Action('getAssets', { namespace: 'assets' }) getAssets

@Getter slippageTolerance!: number
@Getter accountAssets!: Array<AccountAsset> // Wallet store
Expand Down Expand Up @@ -231,7 +232,8 @@ export default class Swap extends Mixins(TranslationMixin, LoadingMixin, NumberF
}

created () {
this.withApi(() => {
this.withApi(async () => {
await this.getAssets()
if (!this.tokenFrom) {
const xorAddress = KnownAssets.get(KnownSymbols.XOR)?.address
this.setTokenFromAddress(xorAddress)
Expand Down