mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
address review comments - add production/dev main.html & remove comments
This commit is contained in:
@@ -1020,7 +1020,8 @@ export default class MarkdownPreview extends React.Component {
|
||||
|
||||
if (!href) return
|
||||
|
||||
const regexNoteInternalLink = /main.html#(.+)/
|
||||
const regexNoteInternalLink = process.env.NODE_ENV === 'production' ? /main.production.html#(.+)/ : /main.development.html#(.+)/
|
||||
|
||||
if (regexNoteInternalLink.test(linkHash)) {
|
||||
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
|
||||
const targetElement = this.refs.root.contentWindow.document.getElementById(
|
||||
|
||||
@@ -8,7 +8,6 @@ import StarButton from './StarButton'
|
||||
import TagSelect from './TagSelect'
|
||||
import FolderSelect from './FolderSelect'
|
||||
import dataApi from 'browser/main/lib/dataApi'
|
||||
// import {hashHistory} from 'react-router'
|
||||
import { history } from 'browser/main/store'
|
||||
import ee from 'browser/main/lib/eventEmitter'
|
||||
import CodeMirror from 'codemirror'
|
||||
|
||||
@@ -12,7 +12,6 @@ import _ from 'lodash'
|
||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||
// import { hashHistory } from 'react-router'
|
||||
import { store, history } from 'browser/main/store'
|
||||
import i18n from 'browser/lib/i18n'
|
||||
import { getLocales } from 'browser/lib/Languages'
|
||||
|
||||
@@ -22,19 +22,14 @@ class NewNoteButton extends React.Component {
|
||||
}
|
||||
|
||||
this.handleNewNoteButtonClick = this.handleNewNoteButtonClick.bind(this)
|
||||
|
||||
// why is there a newNoteHandler?!
|
||||
this.newNoteHandler = () => {
|
||||
this.handleNewNoteButtonClick()
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
eventEmitter.on('top:new-note', this.newNoteHandler)
|
||||
eventEmitter.on('top:new-note', this.handleNewNoteButtonClick)
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
eventEmitter.off('top:new-note', this.newNoteHandler)
|
||||
eventEmitter.off('top:new-note', this.handleNewNoteButtonClick)
|
||||
}
|
||||
|
||||
handleNewNoteButtonClick (e) {
|
||||
|
||||
@@ -469,16 +469,11 @@ function getOrInitItem (target, key) {
|
||||
|
||||
const history = createHistory()
|
||||
|
||||
// Query not available in HashHistory with ReactRouter >= v4
|
||||
// Relevant Issue https://github.com/ReactTraining/react-router/issues/4410#issuecomment-293772446
|
||||
// --> moved from query to search - so we only need query-string parsing/stringify for noteKey.
|
||||
// (No need to add query to history with a listener)
|
||||
|
||||
const reducer = combineReducers({
|
||||
data,
|
||||
config,
|
||||
status,
|
||||
router: connectRouter(history) // I think we could also go with-out connected-router as we're using history with imports directly
|
||||
router: connectRouter(history)
|
||||
})
|
||||
|
||||
const store = createStore(reducer, undefined, compose(
|
||||
|
||||
Reference in New Issue
Block a user