Skip to content

Commit

Permalink
fix: load treasury asset balance only when necessary (#481)
Browse files Browse the repository at this point in the history
* fix: load treasury asset balance only when necessary

* Update apps/ui/src/components/SpaceTreasury.vue

Co-authored-by: Wiktor Tkaczyński <[email protected]>

---------

Co-authored-by: Wiktor Tkaczyński <[email protected]>
  • Loading branch information
wa0x6e and Sekhmet authored Jul 15, 2024
1 parent 9186714 commit ff64516
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/ui/src/components/SpaceTreasury.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ const executionStrategy = computed(() => {
};
});
const hasStakeableAssets = computed(() => {
return !isReadOnly && assets.value.some(asset => asset.contractAddress === ETH_CONTRACT);
});
function openModal(type: 'tokens' | 'nfts' | 'stake') {
modalOpen.value[type] = true;
}
Expand Down Expand Up @@ -324,6 +328,7 @@ watchEffect(() => setTitle(`Treasury - ${props.space.name}`));
</div>
<teleport to="#modal">
<ModalSendToken
v-if="!isReadOnly"
:open="modalOpen.tokens"
:address="treasury.wallet"
:network="treasury.network"
Expand All @@ -341,6 +346,7 @@ watchEffect(() => setTitle(`Treasury - ${props.space.name}`));
@add="addTx"
/>
<ModalStakeToken
v-if="hasStakeableAssets"
:open="modalOpen.stake"
:address="treasury.wallet"
:network="treasury.network"
Expand Down

0 comments on commit ff64516

Please sign in to comment.