Fix Scribe mobile inline never showing modal

- The context.mounted check was placed after onTapFallback?.call()
- The onTapFallback function calls controller.saveAndUnfocusForModal() which unfocuses the editor
- This caused the context to become unmounted so the context.mounted check would return early
- As a result the modal would never be show
This commit is contained in:
Théo Poizat
2026-02-24 10:55:21 +01:00
committed by Dat H. Pham
parent 83452277b7
commit ee546ef744
@@ -43,12 +43,10 @@ class InlineAiAssistButton extends StatelessWidget {
size = renderBox.size;
}
await onTapFallback?.call();
if (!context.mounted) return;
final isScribeMobile = AiScribeMobileUtils.isScribeInMobileMode(context);
await onTapFallback?.call();
await AiScribeModalManager.showAIScribeModal(
isScribeMobile: isScribeMobile,
imagePaths: imagePaths,