Skip to content

Commit

Permalink
fix check of displaying create offer form
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddaqqa committed Nov 7, 2023
1 parent fec428f commit 0cda13e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/wallet/earn/CreateOfferForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export default class CreateOfferForm extends Vue {
/* errors */
get nameLengthError() {
const bytes = new TextEncoder().encode(this.offer.memo)
return bytes.length > MAX_TITLE_BYTE_SIZE || bytes.length === 0
return bytes.length > MAX_TITLE_BYTE_SIZE
}
get minAmountError() {
return this.offer.minAmount.lt(new BN(1000000))
Expand Down
26 changes: 14 additions & 12 deletions src/components/wallet/earn/DepositOffers.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div v-if="hasOffers">
<div>
<h1 class="create-offer-header" v-if="isSuite">Create new DepositOffer</h1>
<h4 class="balance">
<h4 v-if="isSuite || hasOffers" class="balance">
{{ $t('earn.offer.balance') }}: {{ cleanAvaxBN(maxDepositAmount) }}
{{ nativeAssetSymbol }}
</h4>
Expand All @@ -13,19 +13,21 @@
@selectOffer="selectOffer"
:maxDepositAmount="maxDepositAmount"
></CreateOfferForm>
<div class="user_offers" key="list">
<DepositOfferCard
v-for="(o, i) in platformOffers"
:key="'o' + i"
:offer="o"
:maxDepositAmount="maxDepositAmount"
@selectOffer="selectOffer"
class="reward_card"
></DepositOfferCard>
<div v-if="hasOffers">
<div class="user_offers" key="list">
<DepositOfferCard
v-for="(o, i) in platformOffers"
:key="'o' + i"
:offer="o"
:maxDepositAmount="maxDepositAmount"
@selectOffer="selectOffer"
class="reward_card"
></DepositOfferCard>
</div>
</div>
<div v-else class="empty">No Active Saving Pool</div>
</transition>
</div>
<div v-else class="empty">No Active Saving Pool</div>
</template>
<script lang="ts">
import 'reflect-metadata'
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
"submit": "Create Offer"
},
"errors": {
"title": "Offer title must be at least 64 characters long.",
"title": "Offer title should not exceed 64 characters.",
"min_amount": "Minimum amount must be at least {minAmount} {symbol}."
},
"offer": {
Expand Down

0 comments on commit 0cda13e

Please sign in to comment.