From 87ad96cd7fe54a37199929d7a9f317c2b6ef8718 Mon Sep 17 00:00:00 2001 From: Tim Beccue Date: Thu, 28 Sep 2023 14:11:14 -0400 Subject: [PATCH] Remove redundant api calls for fits headers --- .../ImageDisplay/FitsHeaderModal.vue | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/components/ImageDisplay/FitsHeaderModal.vue b/src/components/ImageDisplay/FitsHeaderModal.vue index d61f9a4d..fe559f61 100644 --- a/src/components/ImageDisplay/FitsHeaderModal.vue +++ b/src/components/ImageDisplay/FitsHeaderModal.vue @@ -53,7 +53,6 @@ :data="fitsHeaderTable" :columns="columns" style="width: auto; flex: 0" - :loading="headerIsLoading" /> @@ -76,9 +75,7 @@ export default { }, data () { return { - fitsHeader: {}, showFitsHeaderModal: false, - headerIsLoading: false, columns: [ { field: 'key', @@ -94,41 +91,22 @@ export default { ] } }, - watch: { - image () { - if (this.showFitsHeaderModal) { - this.refreshFitsHeader() - } - } - }, computed: { fitsHeaderTable () { const tableData = [] - for (const property in this.fitsHeader) { + for (const property in this.image.header) { tableData.push({ key: property.toLowerCase(), - val: this.fitsHeader[property] + val: this.image.header[property] }) } return tableData } }, methods: { - refreshFitsHeader () { - this.fitsHeader = {} - this.headerIsLoading = true - this.$store.dispatch('images/loadCurrentImageFitsHeader').then(header => { - this.fitsHeader = header - }).finally(() => { - this.headerIsLoading = false - }) - }, showFitsHeader () { - this.refreshFitsHeader() this.showFitsHeaderModal = true } } } -