Fix loading on status page
It was infinite looping in the computed value for report
This commit is contained in:
parent
ace2557a60
commit
8757f1cda3
3 changed files with 12 additions and 12 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue