Skip to content

Commit

Permalink
Merge pull request #439 from torusresearch/fix/computed-read-only
Browse files Browse the repository at this point in the history
fix: computed read only issue
  • Loading branch information
guru-web3 authored Sep 22, 2023
2 parents d21cee4 + df8beb5 commit c858c22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/common/CurrencySelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props = defineProps<{
token: string;
}>();
const currencies = computed(() => supportedCurrencies(props.token.toUpperCase()));
const currencies = computed(() => supportedCurrencies());
const emits = defineEmits(["onChange"]);
const value = computed({
Expand Down
13 changes: 7 additions & 6 deletions src/components/transfer/TransferTokenSelect.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { Listbox, ListboxButton, ListboxLabel, ListboxOption, ListboxOptions } from "@headlessui/vue";
import { ChevronBottomIcon } from "@toruslabs/vue-icons/arrows";
import { computed, watch } from "vue";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import FallbackNft from "@/assets/nft.png";
Expand All @@ -25,15 +25,16 @@ const props = withDefaults(
}
);
const { t } = useI18n();
const localToken = computed(() => props.selectedToken);
const emits = defineEmits(["update:selectedToken"]);
watch(localToken, () => {
emits("update:selectedToken", localToken.value);
const value = computed({
get: () => {
return props.selectedToken;
},
set: (val) => emits("update:selectedToken", val),
});
</script>
<template>
<Listbox v-model="localToken" as="div">
<Listbox v-model="value" as="div">
<ListboxLabel class="text-sm text-app-text-600 dark:text-app-text-dark-500">{{ t("walletTransfer.selectItem") }}</ListboxLabel>
<div class="mt-1 relative">
<ListboxButton class="bg-white dark:bg-app-gray-800 select-container shadow-inner dark:shadow-none rounded-md w-full px-3">
Expand Down

0 comments on commit c858c22

Please sign in to comment.