From f45f55751ff596de8e97c5a343d652482552b5b8 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 23 Dec 2025 13:24:53 +0700 Subject: [PATCH] hotfix(ai-scribe): Only implement `OnTextSelectionChanged` when `isAIScribeAvailable` is true --- .../composer/presentation/composer_view.dart | 8 ++++++-- .../composer/presentation/composer_view_web.dart | 12 +++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/features/composer/presentation/composer_view.dart b/lib/features/composer/presentation/composer_view.dart index 69f262cdd..c535319fc 100644 --- a/lib/features/composer/presentation/composer_view.dart +++ b/lib/features/composer/presentation/composer_view.dart @@ -248,7 +248,9 @@ class ComposerView extends GetWidget { onCreatedEditorAction: controller.onCreatedMobileEditorAction, onLoadCompletedEditorAction: controller.onLoadCompletedMobileEditorAction, onEditorContentHeightChanged: controller.onEditorContentHeightChangedOnIOS, - onTextSelectionChanged: controller.handleTextSelection, + onTextSelectionChanged: controller.isAIScribeAvailable + ? controller.handleTextSelection + : null, ), )), Obx(() { @@ -437,7 +439,9 @@ class ComposerView extends GetWidget { onCreatedEditorAction: controller.onCreatedMobileEditorAction, onLoadCompletedEditorAction: controller.onLoadCompletedMobileEditorAction, onEditorContentHeightChanged: controller.onEditorContentHeightChangedOnIOS, - onTextSelectionChanged: controller.handleTextSelection, + onTextSelectionChanged: controller.isAIScribeAvailable + ? controller.handleTextSelection + : null, ), )), Obx(() { diff --git a/lib/features/composer/presentation/composer_view_web.dart b/lib/features/composer/presentation/composer_view_web.dart index a2db486c3..e90d5bc23 100644 --- a/lib/features/composer/presentation/composer_view_web.dart +++ b/lib/features/composer/presentation/composer_view_web.dart @@ -268,7 +268,9 @@ class ComposerView extends GetWidget { ), onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb, onKeyDownEditorAction: controller.onKeyDownEditorAction, - onTextSelectionChanged: controller.handleTextSelection, + onTextSelectionChanged: controller.isAIScribeAvailable + ? controller.handleTextSelection + : null, )); } ), @@ -512,7 +514,9 @@ class ComposerView extends GetWidget { ), onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb, onKeyDownEditorAction: controller.onKeyDownEditorAction, - onTextSelectionChanged: controller.handleTextSelection, + onTextSelectionChanged: controller.isAIScribeAvailable + ? controller.handleTextSelection + : null, ); }); } @@ -790,7 +794,9 @@ class ComposerView extends GetWidget { ), onInitialContentLoadComplete: controller.onInitialContentLoadCompleteWeb, onKeyDownEditorAction: controller.onKeyDownEditorAction, - onTextSelectionChanged: controller.handleTextSelection, + onTextSelectionChanged: controller.isAIScribeAvailable + ? controller.handleTextSelection + : null, )); } ),