fix observer optimization, kinda?

feat/vaults
Tomáš Mládek 2021-06-07 01:07:42 +02:00
parent 699335243f
commit 09bf9371d7
1 changed files with 15 additions and 3 deletions

View File

@ -17,7 +17,15 @@
<script lang="ts">
import { identify, useEntity } from "@/lib/entity";
import { computed, ComputedRef, defineComponent, onMounted, ref } from "vue";
import { IEntry } from "@/types/base";
import {
computed,
ComputedRef,
defineComponent,
onMounted,
reactive,
ref,
} from "vue";
import HashBadge from "./HashBadge.vue";
export default defineComponent({
@ -55,9 +63,13 @@ export default defineComponent({
});
// Identification
const { attributes } = useEntity(props.address);
const inferredIds: ComputedRef<string[]> = computed(() => {
return identify(attributes).value.map((eid) => eid.value);
if (visible.value) {
const { attributes } = useEntity(props.address);
return identify(attributes).value.map((eid) => eid.value);
} else {
return [];
}
});
return {