Skip to content

armgit / ente

Public Imported from GitHub
0

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

add clip logout handler

Abhinavef7736dc592b
diff --git a/apps/photos/src/services/clipService.ts b/apps/photos/src/services/clipService.ts
index 8ca1fefa84..fc9dbe424f 100644
--- a/apps/photos/src/services/clipService.ts
+++ b/apps/photos/src/services/clipService.ts
@@ -45,12 +45,22 @@ class ClipServiceImpl {
this.liveEmbeddingExtractionQueue = new PQueue({
concurrency: 1,
});
+ eventBus.on(Events.LOGOUT, this.logoutHandler, this);
}
isPlatformSupported = () => {
return isElectron() && !this.unsupportedPlatform;
};
+ private logoutHandler = async () => {
+ if (this.embeddingExtractionInProgress) {
+ this.embeddingExtractionInProgress?.abort();
+ }
+ if (this.onFileUploadedHandler) {
+ await this.removeOnFileUploadListener();
+ }
+ };
+
setupOnFileUploadListener = async () => {
try {
if (this.unsupportedPlatform) {