Skip to content

Commit 37340d0

Browse files
committed
Fixed issue with double and right click
1 parent 3b110bc commit 37340d0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

browser/components/MarkdownEditor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class MarkdownEditor extends React.Component {
7575
}
7676

7777
handleContextMenu (e) {
78+
if (this.state.isLocked) return
7879
const { config } = this.props
7980
if (config.editor.switchPreview === 'RIGHTCLICK') {
8081
const newStatus = this.state.status === 'PREVIEW' ? 'CODE' : 'PREVIEW'

browser/main/Detail/MarkdownNoteDetail.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class MarkdownNoteDetail extends React.Component {
292292

293293
handleToggleLockButton (event, noteStatus) {
294294
// first argument event is not used
295-
if (this.props.config.editor.switchPreview === 'BLUR' && noteStatus === 'CODE') {
295+
if (noteStatus === 'CODE') {
296296
this.setState({isLockButtonShown: true})
297297
} else {
298298
this.setState({isLockButtonShown: false})
@@ -319,13 +319,14 @@ class MarkdownNoteDetail extends React.Component {
319319

320320
handleSwitchMode (type) {
321321
// If in split mode, hide the lock button
322-
if (type === 'SPLIT') this.setState({isLockButtonShown: false})
323-
this.setState({ editorType: type }, () => {
322+
this.setState({ editorType: type, isLockButtonShown: !(type === 'SPLIT') }, () => {
324323
this.focus()
325324
const newConfig = Object.assign({}, this.props.config)
326325
newConfig.editor.type = type
327326
ConfigManager.set(newConfig)
328327
})
328+
329+
console.log(this.state);
329330
}
330331

331332
handleDeleteNote () {

0 commit comments

Comments
 (0)