mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix(core): debounce doc update time update (#7363)
This commit is contained in:
@@ -48,6 +48,7 @@ import {
|
|||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { use } from 'foxact/use';
|
import { use } from 'foxact/use';
|
||||||
|
import { useDebouncedValue } from 'foxact/use-debounced-value';
|
||||||
import { atom, useAtomValue, useSetAtom } from 'jotai';
|
import { atom, useAtomValue, useSetAtom } from 'jotai';
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
import type {
|
import type {
|
||||||
@@ -674,6 +675,8 @@ export const PagePropertiesTableHeader = ({
|
|||||||
t,
|
t,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const dTimestampElement = useDebouncedValue(timestampElement, 500);
|
||||||
|
|
||||||
const handleCollapse = useCallback(() => {
|
const handleCollapse = useCallback(() => {
|
||||||
onOpenChange(!open);
|
onOpenChange(!open);
|
||||||
}, [onOpenChange, open]);
|
}, [onOpenChange, open]);
|
||||||
@@ -691,7 +694,7 @@ export const PagePropertiesTableHeader = ({
|
|||||||
</div>
|
</div>
|
||||||
</PageBacklinksPopup>
|
</PageBacklinksPopup>
|
||||||
) : null}
|
) : null}
|
||||||
{timestampElement}
|
{dTimestampElement}
|
||||||
</div>
|
</div>
|
||||||
<Divider />
|
<Divider />
|
||||||
<div className={styles.tableHeaderSecondaryRow}>
|
<div className={styles.tableHeaderSecondaryRow}>
|
||||||
|
|||||||
Reference in New Issue
Block a user