[Fix] Reset comment mode hotkey (#6401)
This commit is contained in:
parent
a21375e104
commit
4bd1ffb324
|
|
@ -1,13 +1,10 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Hotkey, Hotkeys } from "@blueprintjs/core";
|
||||
import { HotkeysTarget } from "@blueprintjs/core/lib/esnext/components/hotkeys/hotkeysTarget.js";
|
||||
import { setCommentMode as setCommentModeAction } from "actions/commentActions";
|
||||
|
||||
import { setCommentModeInUrl } from "pages/Editor/ToggleModeButton";
|
||||
|
||||
type Props = {
|
||||
resetCommentMode: () => void;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
|
|
@ -22,7 +19,7 @@ class GlobalHotKeys extends React.Component<Props> {
|
|||
group="Canvas"
|
||||
label="Reset"
|
||||
onKeyDown={(e: any) => {
|
||||
this.props.resetCommentMode();
|
||||
setCommentModeInUrl(false);
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
|
|
@ -30,7 +27,7 @@ class GlobalHotKeys extends React.Component<Props> {
|
|||
combo="v"
|
||||
global
|
||||
label="View Mode"
|
||||
onKeyDown={this.props.resetCommentMode}
|
||||
onKeyDown={() => setCommentModeInUrl(false)}
|
||||
/>
|
||||
<Hotkey
|
||||
combo="c"
|
||||
|
|
@ -47,10 +44,4 @@ class GlobalHotKeys extends React.Component<Props> {
|
|||
}
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch: any) => {
|
||||
return {
|
||||
resetCommentMode: () => dispatch(setCommentModeAction(false)),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(GlobalHotKeys);
|
||||
export default GlobalHotKeys;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import { MAIN_CONTAINER_WIDGET_ID } from "constants/WidgetConstants";
|
|||
import { getSelectedText } from "utils/helpers";
|
||||
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||
import { WIDGETS_SEARCH_ID } from "constants/Explorer";
|
||||
import { setCommentMode as setCommentModeAction } from "actions/commentActions";
|
||||
import { resetSnipingMode as resetSnipingModeAction } from "actions/propertyPaneActions";
|
||||
import { showDebugger } from "actions/debuggerActions";
|
||||
|
||||
|
|
@ -35,7 +34,6 @@ type Props = {
|
|||
deleteSelectedWidget: () => void;
|
||||
cutSelectedWidget: () => void;
|
||||
toggleShowGlobalSearchModal: () => void;
|
||||
resetCommentMode: () => void;
|
||||
resetSnipingMode: () => void;
|
||||
openDebugger: () => void;
|
||||
closeProppane: () => void;
|
||||
|
|
@ -190,7 +188,7 @@ class GlobalHotKeys extends React.Component<Props> {
|
|||
group="Canvas"
|
||||
label="Deselect all Widget"
|
||||
onKeyDown={(e: any) => {
|
||||
this.props.resetCommentMode();
|
||||
setCommentModeInUrl(false);
|
||||
this.props.resetSnipingMode();
|
||||
this.props.deselectAllWidgets();
|
||||
this.props.closeProppane();
|
||||
|
|
@ -203,7 +201,7 @@ class GlobalHotKeys extends React.Component<Props> {
|
|||
global
|
||||
label="Edit Mode"
|
||||
onKeyDown={(e: any) => {
|
||||
this.props.resetCommentMode();
|
||||
setCommentModeInUrl(false);
|
||||
this.props.resetSnipingMode();
|
||||
e.preventDefault();
|
||||
}}
|
||||
|
|
@ -245,7 +243,6 @@ const mapDispatchToProps = (dispatch: any) => {
|
|||
deleteSelectedWidget: () => dispatch(deleteSelectedWidget(true)),
|
||||
cutSelectedWidget: () => dispatch(cutWidget()),
|
||||
toggleShowGlobalSearchModal: () => dispatch(toggleShowGlobalSearchModal()),
|
||||
resetCommentMode: () => dispatch(setCommentModeAction(false)),
|
||||
resetSnipingMode: () => dispatch(resetSnipingModeAction()),
|
||||
openDebugger: () => dispatch(showDebugger()),
|
||||
closeProppane: () => dispatch(closePropertyPane()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user