Graph NG: Invalidate uPlot config on timezone changes (#29531)

This commit is contained in:
Dominik Prokop
2020-12-02 14:21:39 +01:00
committed by GitHub
parent 2a61d7ff9f
commit 974233bf81
2 changed files with 1 additions and 2 deletions

View File

@@ -160,7 +160,7 @@ export const GraphNG: React.FC<GraphNGProps> = ({
legendItemsRef.current = legendItems; legendItemsRef.current = legendItems;
return builder; return builder;
}, [configRev]); }, [configRev, timeZone]);
if (alignedFrameWithGapTest == null) { if (alignedFrameWithGapTest == null) {
return ( return (

View File

@@ -105,7 +105,6 @@ export const DEFAULT_PLOT_CONFIG = {
hooks: {}, hooks: {},
}; };
//pass plain confsig object,memoize!
export const usePlotConfig = (width: number, height: number, timeZone: TimeZone, configBuilder: UPlotConfigBuilder) => { export const usePlotConfig = (width: number, height: number, timeZone: TimeZone, configBuilder: UPlotConfigBuilder) => {
const { arePluginsReady, plugins, registerPlugin } = usePlotPlugins(); const { arePluginsReady, plugins, registerPlugin } = usePlotPlugins();
const [isConfigReady, setIsConfigReady] = useState(false); const [isConfigReady, setIsConfigReady] = useState(false);