fix(ui) - viewtype change for sessions and jsErrors

This commit is contained in:
Shekar Siri 2023-02-06 17:30:47 +01:00 committed by Taha Yassine Kraiem
parent 1083066b3c
commit f6160e7288

View file

@ -101,6 +101,8 @@ export default class MetricStore {
merge(obj: any, updateChangeFlag: boolean = true) {
const type = obj.metricType;
console.log('iobj', obj)
// handle metricType change
if (obj.hasOwnProperty('metricType') && type !== this.instance.metricType) {
this.instance.series.forEach((s: any, i: number) => {
@ -109,6 +111,10 @@ export default class MetricStore {
this.changeType(type);
}
if (obj.hasOwnProperty('metricOf') && obj.metricOf !== this.instance.metricOf && (obj.metricOf === 'sessions' || obj.metricOf === 'jsErrors')) {
obj.viewType = 'table'
}
// handle metricValue change
if (obj.hasOwnProperty('metricValue') && obj.metricValue !== this.instance.metricValue) {
if (Array.isArray(obj.metricValue) && obj.metricValue.length > 1) {