ui: fix widget setData -> create new ref
This commit is contained in:
parent
4972cfad94
commit
55d435be87
2 changed files with 355 additions and 354 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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[]) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue