This commit is contained in:
Manav Rathi 2024-05-15 13:24:05 +05:30
parent e3b7ffaeb4
commit 5dd3315ca2
No known key found for this signature in database
3 changed files with 8 additions and 10 deletions

View file

@ -190,14 +190,6 @@ export default function App({ Component, pageProps }: AppProps) {
}
};
loadMlSearchState();
try {
eventBus.on(Events.LOGOUT, () => {
setMlSearchEnabled(false);
mlWorkManager.setMlSearchEnabled(false);
});
} catch (e) {
log.error("Error while subscribing to logout event", e);
}
}, []);
useEffect(() => {
@ -339,6 +331,7 @@ export default function App({ Component, pageProps }: AppProps) {
});
const logout = () => {
setMlSearchEnabled(false);
void photosLogout().then(() => router.push(PAGES.ROOT));
};

View file

@ -80,7 +80,6 @@ class CLIPService {
this.liveEmbeddingExtractionQueue = new PQueue({
concurrency: 1,
});
eventBus.on(Events.LOGOUT, this.logout, this);
}
isPlatformSupported = () => {
@ -96,7 +95,6 @@ class CLIPService {
}
}
setupOnFileUploadListener = async () => {
try {
if (this.onFileUploadedHandler) {

View file

@ -2,6 +2,7 @@ import log from "@/next/log";
import { accountLogout } from "@ente/accounts/services/logout";
import { Events, eventBus } from "@ente/shared/events";
import { clipService } from "services/clip-service";
import mlWorkManager from "./machineLearning/mlWorkManager";
/**
* Logout sequence for the photos app.
@ -19,6 +20,12 @@ export const photosLogout = async () => {
log.error("Ignoring error in CLIP logout", e);
}
try {
await mlWorkManager.setMlSearchEnabled(false);
} catch (e) {
log.error("Ignoring error in ML logout", e);
}
const electron = globalThis.electron;
if (electron) {
try {