message: bug: timeline interval is updated
diff: -import React, { useState, useMemo } from 'react';
  -import { isEqual } from 'lodash-es';
  +import React, { useState, useMemo, useEffect } from 'react';
  import styles from './style.module.css';
  import { useMeasure } from 'react-use';
  -import { toFixed } from 'utils/toFixed';
  -import {
  - INTERVAL_UNITS,
  - resolveTimeFromInterval,
  -} from 'container/TraceDetail/utils';
  +import { INTERVAL_UNITS } from 'container/TraceDetail/utils';
  import useThemeMode from 'hooks/useThemeMode';
  import { Interval } from './types';
  import { getIntervalSpread, getIntervals } from './utils';
  -interface TimelineProps {
  - traceMetaData: object;
  - globalTraceMetadata: object;
  - intervalUnit: object;
  - setIntervalUnit: Function;
  -}
  +
  +const Timeline_Height = 22;
  +const Timeline_H_Spacing = 0;
  +
  const Timeline = ({
  traceMetaData,
  globalTraceMetadata,
  - intervalUnit,
  setIntervalUnit,
  }: TimelineProps) => {
  const [ref, { width }] = useMeasure<HTMLDivElement>();
  const { isDarkMode } = useThemeMode();
  - const Timeline_Height = 22;
  - const Timeline_H_Spacing = 0;
  -
  const [intervals, setIntervals] = useState<Interval[] | null>(null);
  - useMemo(() => {
  + useEffect(() => {
  const {
  baseInterval,
  baseSpread,
  @@ -44,7 +33,7 @@ const Timeline = ({
  for (const idx in INTERVAL_UNITS) {
  const standard_interval = INTERVAL_UNITS[idx];
  if (baseSpread * standard_interval.multiplier < 1) {
  - intervalUnit = INTERVAL_UNITS[idx - 1];
  + intervalUnit = INTERVAL_UNITS[idx];
  break;
  }
  }
  @@ -58,7 +47,7 @@ const Timeline = ({
  intervalUnit,
  }),
  );
  - }, [traceMetaData, globalTraceMetadata]);
  + }, []);
  return (
  <div ref={ref} style={{ flex: 1, overflow: 'inherit' }}>
  @@ -102,4 +91,11 @@ const Timeline = ({
  );
  };
  +interface TimelineProps {
  + traceMetaData: object;
  + globalTraceMetadata: object;
  + intervalUnit: object;
  + setIntervalUnit: Function;
  +}
  +
  export default Timeline;
  