diff --git a/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx b/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx index 51fb561ee1..76fc59b6f5 100644 --- a/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx +++ b/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx @@ -12,6 +12,8 @@ import { useCodeMirrorViewContext } from '../../codemirror-editor' import Modal, { useBulkActionsModal } from '../entries/bulk-actions-entry/modal' import getMeta from '../../../../../utils/meta' import useScopeValue from '../../../../../shared/hooks/use-scope-value' +import useScopeEventListener from '@/shared/hooks/use-scope-event-listener' +import { useCallback } from 'react' function EditorWidgets() { const { t } = useTranslation() @@ -54,6 +56,13 @@ function EditorWidgets() { }, 0) } + useScopeEventListener( + 'comment:start_adding', + useCallback(() => { + setIsAddingComment(true) + }, [setIsAddingComment]) + ) + return ReactDOM.createPortal( <>
diff --git a/services/web/frontend/js/ide/review-panel/controllers/ReviewPanelController.js b/services/web/frontend/js/ide/review-panel/controllers/ReviewPanelController.js index c4bd22dd7d..5ec471dd04 100644 --- a/services/web/frontend/js/ide/review-panel/controllers/ReviewPanelController.js +++ b/services/web/frontend/js/ide/review-panel/controllers/ReviewPanelController.js @@ -786,7 +786,7 @@ export default App.controller('ReviewPanelController', [ ide.$scope.addNewComment = function (e) { e.preventDefault() - $scope.$broadcast('comment:start_adding') + ide.$scope.$broadcast('comment:start_adding') return $scope.toggleReviewPanel() } @@ -802,7 +802,7 @@ export default App.controller('ReviewPanelController', [ } return $timeout(function () { ide.$scope.$broadcast('review-panel:layout') - return $scope.$broadcast('comment:start_adding') + ide.$scope.$broadcast('comment:start_adding') }) }