chore: Remove setimmediate polyfill (#4903)

* Add setimmediate to dependencies

* Remove use of setimmediate
This commit is contained in:
Tom Moor
2023-02-20 11:24:14 -05:00
committed by GitHub
parent a9e373c72f
commit c33a4103e7
6 changed files with 5 additions and 6 deletions

View File

@@ -311,7 +311,7 @@ function DocumentExplorer({ onSubmit, onSelect, items }: Props) {
if (!searchTerm) {
toggleCollapse(activeNode);
// let the nodes re-render first and then scroll
setImmediate(() => scrollNodeIntoView(activeNode));
setTimeout(() => scrollNodeIntoView(activeNode), 0);
}
break;
}

View File

@@ -1,7 +1,6 @@
// eslint-disable-next-line import/no-unresolved
import "vite/modulepreload-polyfill";
import "focus-visible";
import "setimmediate";
import { LazyMotion } from "framer-motion";
import { KBarProvider } from "kbar";
import { Provider } from "mobx-react";

View File

@@ -53,7 +53,7 @@ class ImageUpload extends React.Component<RootStore & Props> {
this.isUploading = true;
// allow the UI to update before converting the canvas to a Blob
// for large images this can cause the page rendering to hang.
setImmediate(this.uploadImage);
setTimeout(this.uploadImage, 0);
};
uploadImage = async () => {

View File

@@ -128,7 +128,7 @@ export default class AuthStore {
this.addPolicies(data.policies);
if (this.token) {
setImmediate(() => this.fetch());
setTimeout(() => this.fetch(), 0);
}
}