diff --git a/browser/lib/newNote.js b/browser/lib/newNote.js index 855de0d0..0b64d0e1 100644 --- a/browser/lib/newNote.js +++ b/browser/lib/newNote.js @@ -3,11 +3,14 @@ import dataApi from 'browser/main/lib/dataApi' import ee from 'browser/main/lib/eventEmitter' import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig' -export function createMarkdownNote (storage, folder, dispatch, location, params) { +export function createMarkdownNote (storage, folder, dispatch, location, params, config) { AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_MARKDOWN') AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE') - const tags = location.pathname.match(/\/tags/) ? params.tagname.split(' ') : [] + let tags = [] + if (config.ui.tagNewNoteWithFilteringTags && location.pathname.match(/\/tags/)) { + tags = params.tagname.split(' ') + } return dataApi .createNote(storage, { @@ -37,7 +40,10 @@ export function createSnippetNote (storage, folder, dispatch, location, params, AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET') AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE') - const tags = location.pathname.match(/\/tags/) ? params.tagname.split(' ') : [] + let tags = [] + if (config.ui.tagNewNoteWithFilteringTags && location.pathname.match(/\/tags/)) { + tags = params.tagname.split(' ') + } return dataApi .createNote(storage, { diff --git a/browser/main/NewNoteButton/index.js b/browser/main/NewNoteButton/index.js index 2b756ef4..c34443be 100644 --- a/browser/main/NewNoteButton/index.js +++ b/browser/main/NewNoteButton/index.js @@ -39,7 +39,7 @@ class NewNoteButton extends React.Component { const { storage, folder } = this.resolveTargetFolder() if (config.ui.defaultNote === 'MARKDOWN_NOTE') { - createMarkdownNote(storage.key, folder.key, dispatch, location, params) + createMarkdownNote(storage.key, folder.key, dispatch, location, params, config) } else if (config.ui.defaultNote === 'SNIPPET_NOTE') { createSnippetNote(storage.key, folder.key, dispatch, location, params, config) } else { diff --git a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js index 44a08dcc..a190602c 100644 --- a/browser/main/modals/NewNoteModal.js +++ b/browser/main/modals/NewNoteModal.js @@ -21,8 +21,8 @@ class NewNoteModal extends React.Component { } handleMarkdownNoteButtonClick (e) { - const { storage, folder, dispatch, location, params } = this.props - createMarkdownNote(storage, folder, dispatch, location, params).then(() => { + const { storage, folder, dispatch, location, params, config } = this.props + createMarkdownNote(storage, folder, dispatch, location, params, config).then(() => { setTimeout(this.props.close, 200) }) } diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 97f3877c..8bc81b43 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -68,6 +68,7 @@ class UiTab extends React.Component { theme: this.refs.uiTheme.value, language: this.refs.uiLanguage.value, defaultNote: this.refs.defaultNote.value, + tagNewNoteWithFilteringTags: this.refs.tagNewNoteWithFilteringTags.checked, showCopyNotification: this.refs.showCopyNotification.checked, confirmDeletion: this.refs.confirmDeletion.checked, showOnlyRelatedTags: this.refs.showOnlyRelatedTags.checked, @@ -226,6 +227,16 @@ class UiTab extends React.Component { +