slight clean up, resolve top addresses, comments
parent
3ba3f0fe07
commit
80a920ef04
|
@ -44,6 +44,7 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
setup(props) {
|
||||
// Enable IntersectionObserver for performance reasons
|
||||
const rootEl = ref<HTMLElement | undefined>();
|
||||
const visible = ref(false);
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
|
@ -55,13 +56,15 @@ export default defineComponent({
|
|||
}
|
||||
});
|
||||
|
||||
// Set up resolving; retrieve all entries of address
|
||||
const { data: addressEntries } = useSWRV<ListingResult, unknown>(
|
||||
() => (visible.value && `/api/obj/${props.address}`) || null,
|
||||
fetcher
|
||||
);
|
||||
|
||||
// Out of those, pick out and retrieve those that are referred to as TYPE_ID
|
||||
const { data: typeId } = useSWRV<ListingResult, unknown>(() => {
|
||||
if (!props.isFile && props.resolve) {
|
||||
if (props.resolve) {
|
||||
const entries = Object.values(addressEntries?.value || {});
|
||||
const isEntry = entries.find(
|
||||
(entry) => entry.entity === props.address && entry.attribute === "IS"
|
||||
|
@ -73,6 +76,7 @@ export default defineComponent({
|
|||
return null;
|
||||
}, fetcher);
|
||||
|
||||
// Return Values of TYPE_ID entries
|
||||
const inferredId = computed(() => {
|
||||
const typeIdValue = Object.values(typeId?.value || {})[0];
|
||||
if (typeIdValue) {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<Address
|
||||
:address="address"
|
||||
:is-file="backlinks.some(([_, e]) => e.attribute === 'FILE_IS')"
|
||||
:resolve="false"
|
||||
/>
|
||||
</h2>
|
||||
<div v-if="!error">
|
||||
|
|
Loading…
Reference in New Issue