mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
CloudMonitor: Correctly re-render VisualMetricQueryEditor on TimeRange updates (#66756)
Compare string value rather than object
This commit is contained in:
+5
-1
@@ -48,7 +48,11 @@ export function Editor({
|
||||
const [timeRange, setTimeRange] = useState<TimeRange>({ ...datasource.timeSrv.timeRange() });
|
||||
|
||||
const useTime = (time: TimeRange) => {
|
||||
if (timeRange !== null && (timeRange.raw.from !== time.raw.from || timeRange.raw.to !== time.raw.to)) {
|
||||
if (
|
||||
timeRange !== null &&
|
||||
(timeRange.raw.from.toString() !== time.raw.from.toString() ||
|
||||
timeRange.raw.to.toString() !== time.raw.to.toString())
|
||||
) {
|
||||
setTimeRange({ ...time });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user