From ec1d3e6e4e47b81413c4c910f5fdf6a84aa5f482 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sun, 20 Mar 2022 11:36:43 +0530 Subject: [PATCH] clear ml db on ml disable --- src/components/Sidebar.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 862022a69..5de6dd650 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -37,6 +37,7 @@ import FixLargeThumbnails from './FixLargeThumbnail'; import { AppContext } from 'pages/_app'; import { canEnableMlSearch } from 'utils/machineLearning/compatibility'; import { SetLoading } from 'types/gallery'; +import mlIDbStorage from 'utils/storage/mlIDbStorage'; interface Props { collections: Collection[]; setDialogMessage: SetDialogMessage; @@ -62,6 +63,7 @@ export default function Sidebar(props: Props) { }; const disableMlSearch = async () => { await appContext.updateMlSearchEnabled(false); + await mlIDbStorage.clearMLDB(); }; useEffect(() => { const main = async () => {