Skip to content

Commit 07a7aa4

Browse files
gh2049chen_gh
and
chen_gh
authored
fix(time-picker): error (#2235)
Co-authored-by: chen_gh <[email protected]>
1 parent a265659 commit 07a7aa4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/static-past-time-picker/StaticPastTimePicker.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ function StaticPastTimePicker({
6767
],
6868
[experimental, localLocale]
6969
);
70-
const options = useMemo(() => quickOptions || localQuickOptions, [quickOptions, localQuickOptions]);
71-
72-
earliestApprove && options.push({ value: 'earliest', label: localLocale.earliestInHistory });
70+
const options = useMemo(
71+
() => [
72+
...(quickOptions || localQuickOptions),
73+
...(earliestApprove ? [{ value: 'earliest', label: localLocale.earliestInHistory }] : []),
74+
],
75+
[quickOptions, localQuickOptions, earliestApprove, localLocale]
76+
);
7377

7478
const parseMode = useCallback((current: string | undefined) => parseTimeMode(current, options), [options]);
7579
const originMode = (parseMode(timeRange) ?? TimeMode.Quick) as TimeMode;

0 commit comments

Comments
 (0)