mlwm
This commit is contained in:
parent
e3b7ffaeb4
commit
5dd3315ca2
3 changed files with 8 additions and 10 deletions
|
@ -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));
|
||||
};
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue