Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

replace debounce package

Abhinav822c8dbdd560
diff --git a/apps/photos/package.json b/apps/photos/package.json
index 4fbbcd56e2..0d5381c817 100644
--- a/apps/photos/package.json
+++ b/apps/photos/package.json
@@ -27,7 +27,7 @@
"bs58": "^5.0.0",
"chrono-node": "^2.2.6",
"comlink": "^4.3.0",
- "debounce-promise": "^3.1.2",
+ "debounce": "^2.0.0",
"density-clustering": "^1.3.0",
"eventemitter3": "^4.0.7",
"exifr": "^7.1.3",
@@ -81,7 +81,6 @@
"devDependencies": {
"@next/bundle-analyzer": "^13.4.12",
"@types/bs58": "^4.0.1",
- "@types/debounce-promise": "^3.1.3",
"@types/leaflet": "^1.9.3",
"@types/libsodium-wrappers": "^0.7.8",
"@types/node": "^14.6.4",
diff --git a/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx b/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx
index ca25436b58..6fa2a3e381 100644
--- a/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx
+++ b/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx
@@ -1,5 +1,5 @@
import { IconButton } from '@mui/material';
-import debounce from 'debounce-promise';
+import debounce from 'debounce';
import { AppContext } from 'pages/_app';
import React, {
useCallback,
diff --git a/apps/photos/src/services/machineLearning/mlWorkManager.ts b/apps/photos/src/services/machineLearning/mlWorkManager.ts
index 3673744d0c..98a21984cc 100644
--- a/apps/photos/src/services/machineLearning/mlWorkManager.ts
+++ b/apps/photos/src/services/machineLearning/mlWorkManager.ts
@@ -1,4 +1,4 @@
-import debounce from 'debounce-promise';
+import debounce from 'debounce';
import PQueue from 'p-queue';
import { eventBus, Events } from '@ente/shared/events';
import { EnteFile } from 'types/file';
diff --git a/apps/photos/src/services/watchFolder/watchFolderService.ts b/apps/photos/src/services/watchFolder/watchFolderService.ts
index fadac28422..f1fe3e3597 100644
--- a/apps/photos/src/services/watchFolder/watchFolderService.ts
+++ b/apps/photos/src/services/watchFolder/watchFolderService.ts
@@ -9,7 +9,7 @@ import {
WatchMapping,
WatchMappingSyncedFile,
} from 'types/watchFolder';
-import debounce from 'debounce-promise';
+import debounce from 'debounce';
import {
diskFileAddedCallback,
diskFileRemovedCallback,
@@ -160,7 +160,7 @@ class watchFolderService {
pushEvent(event: EventQueueItem) {
this.eventQueue.push(event);
- debounce(this.runNextEvent.bind(this), 300)();
+ debounce(async () => await this.runNextEvent(), 300)();
}
async pushTrashedDir(path: string) {
diff --git a/yarn.lock b/yarn.lock
index f0e6d3532b..8df0c7c344 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -744,11 +744,6 @@
dependencies:
base-x "^3.0.6"
-"@types/debounce-promise@^3.1.3":
- version "3.1.4"
- resolved "https://registry.npmjs.org/@types/debounce-promise/-/debounce-promise-3.1.4.tgz"
- integrity sha512-9SEVY3nsz+uMN2DwDocftB5TAgZe7D0cOzxxRhpotWs6T4QFqRaTXpXbOSzbk31/7iYcfCkJJPwWGzTxyuGhCg==
-
"@types/estree@*", "@types/estree@^1.0.0":
version "1.0.1"
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz"
@@ -1622,10 +1617,10 @@ dayjs@^1.10.0:
resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz"
integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==
-debounce-promise@^3.1.2:
- version "3.1.2"
- resolved "https://registry.npmjs.org/debounce-promise/-/debounce-promise-3.1.2.tgz"
- integrity sha512-rZHcgBkbYavBeD9ej6sP56XfG53d51CD4dnaw989YX/nZ/ZJfgRx/9ePKmTNiUiyQvh4mtrMoS3OAWW+yoYtpg==
+debounce@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/debounce/-/debounce-2.0.0.tgz#b2f914518a1481466f4edaee0b063e4d473ad549"
+ integrity sha512-xRetU6gL1VJbs85Mc4FoEGSjQxzpdxRyFhe3lmWFyy2EzydIcD4xzUvRJMD+NPDfMwKNhxa3PvsIOU32luIWeA==
debug@4, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
version "4.3.4"