clear ml db on ml disable

This commit is contained in:
Abhinav 2022-03-20 11:36:43 +05:30
parent 233073c90a
commit ec1d3e6e4e

View file

@ -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 () => {