hotfix(ai-scribe): Fix text selection handler correctly gated by AI Scribe availability.

This commit is contained in:
dab246
2025-12-23 17:37:32 +07:00
committed by Dat H. Pham
parent f45f55751f
commit 20b93cd8db
3 changed files with 9 additions and 15 deletions
@@ -248,9 +248,7 @@ class ComposerView extends GetWidget<ComposerController> {
onCreatedEditorAction: controller.onCreatedMobileEditorAction,
onLoadCompletedEditorAction: controller.onLoadCompletedMobileEditorAction,
onEditorContentHeightChanged: controller.onEditorContentHeightChangedOnIOS,
onTextSelectionChanged: controller.isAIScribeAvailable
? controller.handleTextSelection
: null,
onTextSelectionChanged: controller.textSelectionHandler,
),
)),
Obx(() {
@@ -439,9 +437,7 @@ class ComposerView extends GetWidget<ComposerController> {
onCreatedEditorAction: controller.onCreatedMobileEditorAction,
onLoadCompletedEditorAction: controller.onLoadCompletedMobileEditorAction,
onEditorContentHeightChanged: controller.onEditorContentHeightChangedOnIOS,
onTextSelectionChanged: controller.isAIScribeAvailable
? controller.handleTextSelection
: null,
onTextSelectionChanged: controller.textSelectionHandler,
),
)),
Obx(() {
@@ -268,9 +268,7 @@ class ComposerView extends GetWidget<ComposerController> {
),
onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb,
onKeyDownEditorAction: controller.onKeyDownEditorAction,
onTextSelectionChanged: controller.isAIScribeAvailable
? controller.handleTextSelection
: null,
onTextSelectionChanged: controller.textSelectionHandler,
));
}
),
@@ -514,9 +512,7 @@ class ComposerView extends GetWidget<ComposerController> {
),
onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb,
onKeyDownEditorAction: controller.onKeyDownEditorAction,
onTextSelectionChanged: controller.isAIScribeAvailable
? controller.handleTextSelection
: null,
onTextSelectionChanged: controller.textSelectionHandler,
);
});
}
@@ -794,9 +790,7 @@ class ComposerView extends GetWidget<ComposerController> {
),
onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb,
onKeyDownEditorAction: controller.onKeyDownEditorAction,
onTextSelectionChanged: controller.isAIScribeAvailable
? controller.handleTextSelection
: null,
onTextSelectionChanged: controller.textSelectionHandler,
));
}
),
@@ -147,4 +147,8 @@ extension HandleAiScribeInComposerExtension on ComposerController {
editorTextSelection.value = null;
}
}
void Function(TextSelectionData? textSelectionData)?
get textSelectionHandler =>
isAIScribeAvailable ? handleTextSelection : null;
}