From abd0dedc5759cf3bcb0c86ecff164f2bea994850 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Sat, 6 Jul 2024 22:21:35 +0700 Subject: [PATCH] [mob][photos] Debug option --- .../settings/debug/ml_debug_section_widget.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mobile/lib/ui/settings/debug/ml_debug_section_widget.dart b/mobile/lib/ui/settings/debug/ml_debug_section_widget.dart index 19a90ead9b..4aa0d85224 100644 --- a/mobile/lib/ui/settings/debug/ml_debug_section_widget.dart +++ b/mobile/lib/ui/settings/debug/ml_debug_section_widget.dart @@ -348,7 +348,22 @@ class _MLDebugSectionWidgetState extends State { trailingIcon: Icons.chevron_right_outlined, trailingIconIsMuted: true, onTap: () async { - await SemanticSearchService.instance.clearIndexes(); + await showChoiceDialog( + context, + title: "Are you sure?", + body: + "You will need to again re-index or fetch all clip image embeddings.", + firstButtonLabel: "Yes, confirm", + firstButtonOnTap: () async { + try { + await SemanticSearchService.instance.clearIndexes(); + showShortToast(context, "Done"); + } catch (e, s) { + _logger.warning('drop clip embeddings failed ', e, s); + await showGenericErrorDialog(context: context, error: e); + } + }, + ); }, ), ],