ui: fix widget setData -> create new ref

This commit is contained in:
nick-delirium 2025-05-13 11:20:45 +02:00
parent 4972cfad94
commit 55d435be87
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 355 additions and 354 deletions

View file

@ -74,7 +74,6 @@ function WidgetSessions(props: Props) {
}
}
setLoading(true);
const filterCopy = { ...filter };
delete filterCopy.eventsOrderSupport;
@ -195,7 +194,7 @@ function WidgetSessions(props: Props) {
metricStore.clickMapSearch,
focusedSeries,
widget.startPoint,
widget.data.nodes,
widget.data?.nodes,
metricStore.disabledSeries.length,
]);
useEffect(loadData, [metricStore.sessionsPage]);

View file

@ -1,4 +1,4 @@
import { makeAutoObservable, runInAction } from 'mobx';
import { makeAutoObservable, runInAction, observable } from 'mobx';
import FilterSeries from './filterSeries';
import { DateTime } from 'luxon';
import Session from 'App/mstore/types/session';
@ -433,13 +433,15 @@ export default class Widget {
}
if (!isComparison) {
runInAction(() => {
Object.assign(this.data, _data);
});
this.setDataValue(_data);
}
return _data;
}
setDataValue = (data: any) => {
this.data = observable({ ...data });
};
fetchSessions(metricId: any, filter: any): Promise<any> {
return new Promise((resolve) => {
metricService.fetchSessions(metricId, filter).then((response: any[]) => {