fix: timers type in browser env (#3875)

This commit is contained in:
Camol
2023-08-22 03:14:25 +08:00
committed by GitHub
parent eda5ff4d3f
commit fc9981335b
11 changed files with 19 additions and 19 deletions

View File

@@ -183,7 +183,7 @@ const BookMarkUI = ({ page }: BookMarkProps) => {
if (!shouldShowBookmarkMenu(pastedBlocks)) {
return;
}
setTimeout(() => {
window.setTimeout(() => {
setAnchor(getCurrentNativeRange());
}, 100);
});

View File

@@ -72,10 +72,10 @@ const ImagePreviewModalImpl = (
const [hasPlayedAnimation, setHasPlayedAnimation] = useState<boolean>(false);
useEffect(() => {
let timeoutId: NodeJS.Timeout;
let timeoutId: number;
if (!isOpen) {
timeoutId = setTimeout(() => {
timeoutId = window.setTimeout(() => {
props.onClose();
setIsOpen(true);
}, 300);