refresh edited insights panel on change (#10180)

* refresh edited insights panel on change

* move api simpleHash to shared utils getSimpleHash

* Simply reactivity fix for time-series

* Remove unused import

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Azri Kahar
2021-12-02 01:26:55 +08:00
committed by GitHub
parent 569a8dd7db
commit 8dec148ca2
5 changed files with 21 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ import api from '@/api';
import ApexCharts from 'apexcharts';
import { adjustDate } from '@/utils/adjust-date';
import { useI18n } from 'vue-i18n';
import { isEqual, isNil } from 'lodash';
import { isNil } from 'lodash';
import { useFieldsStore } from '@/stores';
import { Filter } from '@directus/shared/types';
import { abbreviateNumber } from '@/utils/abbreviate-number';
@@ -111,13 +111,11 @@ export default defineComponent({
});
watch(
[() => props, () => props.showHeader, () => props.height],
(newVal, oldVal) => {
if (isEqual(newVal, oldVal) === false) {
fetchData();
chart.value?.destroy();
setupChart();
}
() => props,
() => {
fetchData();
chart.value?.destroy();
setupChart();
},
{ deep: true }
);