diff --git a/package-lock.json b/package-lock.json index e5f9cdab..e41b659a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,6 @@ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", "@types/geojson": "^7946.0.14", "@types/leaflet": "^1.7.11", - "@types/node": "^20.12.1", "@types/react": "^18.2.0", "@types/react-dom": "^18.0.5", "@typescript-eslint/eslint-plugin": "^5.62.0", @@ -455,16 +454,6 @@ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, - "node_modules/@types/node": { - "version": "20.12.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.1.tgz", - "integrity": "sha512-5lcxgB72hlSF7ZS9ZzX1RCLc9+BovxjL17T00xSmj3c0ygZFjPdNnN0RchfGpot/yniVMkWnyO6aR9Dr1q9qrg==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/@types/offscreencanvas": { "version": "2019.7.1", "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.1.tgz", @@ -7168,13 +7157,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, "node_modules/unified": { "version": "11.0.4", "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", diff --git a/package.json b/package.json index 5fb22ce0..62f70c92 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", "@types/geojson": "^7946.0.14", "@types/leaflet": "^1.7.11", - "@types/node": "^20.12.1", "@types/react": "^18.2.0", "@types/react-dom": "^18.0.5", "@typescript-eslint/eslint-plugin": "^5.62.0", diff --git a/src/Components/Profile/itemFunctions.ts b/src/Components/Profile/itemFunctions.ts index d1f35043..b9baa1d4 100644 --- a/src/Components/Profile/itemFunctions.ts +++ b/src/Components/Profile/itemFunctions.ts @@ -9,8 +9,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { setTimeout } from 'timers/promises' - import { toast } from 'react-toastify' import { Item } from '#src/types' @@ -18,6 +16,9 @@ import { encodeTag } from '#utils/FormatTags' import { hashTagRegex } from '#utils/HashTagRegex' import { randomColor } from '#utils/RandomColor' +// eslint-disable-next-line promise/avoid-new +const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) + export const submitNewItem = async ( evt: any, type: string, @@ -224,7 +225,7 @@ export const onUpdateItem = async ( }) // take care that addTag request comes before item request - await setTimeout(200) + await sleep(200) if (!item.new) { item?.layer?.api?.updateItem &&