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

fix: computed read only issue #439

Merged
merged 1 commit into from
Sep 22, 2023
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
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
Loading