fix(ui): total/count change as per the api response (#2921)

This commit is contained in:
Shekar Siri 2025-01-07 10:55:01 +01:00 committed by GitHub
parent 65d83e91c5
commit 82854d014d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ interface Props {
function SessionsBy(props: Props) {
const { metric = {}, data = { values: [] }, onClick = () => null, isTemplate } = props;
const [selected, setSelected] = React.useState<any>(null);
const total = data.count;
const total = data.total;
const { openModal, closeModal } = useModal();
const modalMetric = React.useMemo(() => Object.assign(new Widget(), metric), [metric]);

View file

@ -314,9 +314,9 @@ export default class Widget {
} else if (this.metricType === FUNNEL) {
_data.funnel = new Funnel().fromJSON(_data);
} else if (this.metricType === TABLE) {
const total = data[0]['total'];
// const total = data[0]['total'];
const count = data[0]['count'];
_data[0]['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, total, this.metricOf));
_data[0]['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, count, this.metricOf));
} else {
if (data.hasOwnProperty('chart')) {
_data['value'] = data.value;