Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Aug 5, 2024
1 parent 624b5b3 commit 63c531d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions resources/js/components/pages/create/CreateToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
</template>

<script setup lang="ts">
import { computed, ref } from 'vue';
import { computed, ref, watch } from 'vue';
import { Form } from 'vee-validate';
import * as yup from 'yup';
import Btn from '~/components/Btn.vue';
Expand Down Expand Up @@ -357,7 +357,7 @@ const imageType = ref();
const name = ref('');
const description = ref('');
const tokenType = ref('nft');
const capType = ref(TokenCapType.INFINITE);
const capType = ref(TokenCapType.SINGLE_MINT);
//Advanced
const collectionId = ref('');
Expand Down Expand Up @@ -469,12 +469,7 @@ const createToken = async () => {
tokenId: formatToken(tokenId.value),
initialSupply: initialSupply.value,
cap: {
type:
tokenType.value === 'ft'
? capAmount.value > 0
? TokenCapType.SUPPLY
: TokenCapType.INFINITE
: TokenCapType.SINGLE_MINT,
type: capType.value,
amount: capAmount.value,
},
behavior: {
Expand Down Expand Up @@ -529,4 +524,15 @@ const addAttributeItem = () => {
const removeAttributeItem = (index: number) => {
attributes.value.splice(index, 1);
};
watch(
() => tokenType.value,
() => {
if (tokenType.value === 'nft') {
capType.value = TokenCapType.SINGLE_MINT;
} else {
capType.value = TokenCapType.INFINITE;
}
}
);
</script>

0 comments on commit 63c531d

Please sign in to comment.