Fix loading on status page

It was infinite looping in the computed value for report
This commit is contained in:
Eli Ribble 2026-05-01 01:52:11 +00:00
parent ace2557a60
commit 8757f1cda3
No known key found for this signature in database
3 changed files with 12 additions and 12 deletions

View file

@ -146,7 +146,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, computed } from "vue";
import { computed, onMounted, ref } from "vue";
import { computedAsync } from "@vueuse/core";
import Header from "@/rmo/components/Header.vue";
import HeaderDistrict from "@/components/HeaderDistrict.vue";
@ -170,12 +170,10 @@ interface Props {
}
const props = defineProps<Props>();
const report = ref<PublicReport | null>(null);
const storeDistrict = useStoreDistrict();
const storePublicReport = useStorePublicReport();
// Computed
const report = computedAsync(async (): Promise<PublicReport | undefined> => {
return await storePublicReport.byID(props.id);
});
const district = computedAsync(async (): Promise<District | undefined> => {
if (!(report.value && report.value.district)) {
return undefined;
@ -200,4 +198,8 @@ const markers = computed((): Marker[] => {
},
];
});
onMounted(async () => {
const r = await storePublicReport.byID(props.id);
report.value = r;
});
</script>