fix(ui): sync dashboards edits properly
This commit is contained in:
parent
99a83fab5e
commit
3188b0ad6f
2 changed files with 8 additions and 2 deletions
|
|
@ -68,6 +68,8 @@ function DashboardView(props: Props) {
|
|||
onAddWidgets();
|
||||
trimQuery();
|
||||
}
|
||||
|
||||
return () => dashboardStore.resetSelectedDashboard()
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -216,9 +216,9 @@ export default class DashboardStore {
|
|||
syncDashboardInfo(id: string, info: { name: string, description: string, isPublic: boolean, createdAt: number }) {
|
||||
if (this.selectedDashboard !== null) {
|
||||
this.selectedDashboard.updateInfo(info)
|
||||
const index = this.dashboards.findIndex((d) => d.dashboardId === id);
|
||||
this.dashboards[index].updateInfo(info);
|
||||
}
|
||||
const index = this.dashboards.findIndex((d) => d.dashboardId === id);
|
||||
this.dashboards[index].updateInfo(info);
|
||||
}
|
||||
|
||||
saveMetric(metric: Widget, dashboardId: string): Promise<any> {
|
||||
|
|
@ -320,6 +320,10 @@ export default class DashboardStore {
|
|||
}
|
||||
};
|
||||
|
||||
resetSelectedDashboard = () => {
|
||||
this.selectedDashboard = null
|
||||
}
|
||||
|
||||
setSiteId = (siteId: any) => {
|
||||
this.siteId = siteId;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue