1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-02-07 21:11:40 +00:00

fix build env

This commit is contained in:
Rokt33r
2015-10-19 11:46:58 +09:00
parent 55db0bebbb
commit 7459e937b5
15 changed files with 126 additions and 29 deletions

View File

@@ -1,6 +1,10 @@
var fs = require('fs')
var path = require('path')
var url = path.resolve(process.cwd(), './submodules/ace/src-min')
var rootUrl = process.cwd()
if (rootUrl === '/') rootUrl = require('remote').require('app').getAppPath()
var url = path.resolve(rootUrl, './submodules/ace/src-min')
console.log(url)
module.exports = fs.readdirSync(url)
.filter(function (file) {

View File

@@ -81,8 +81,12 @@ function articles (state, action) {
let articles = JSON.parse(localStorage.getItem(teamKey))
let targetIndex = findIndex(articles, _article => article.key === _article.key)
console.log('before')
console.log(articles)
if (targetIndex < 0) articles.unshift(article)
else articles.splice(targetIndex, 1, article)
console.log('after')
console.log(articles)
localStorage.setItem(teamKey, JSON.stringify(articles))
state[teamKey] = articles

View File

@@ -1,20 +1,26 @@
import React from 'react'
import reducer from './reducer'
import { createStore } from 'redux'
// Devtools
import { compose } from 'redux'
import { devTools, persistState } from 'redux-devtools'
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
// import React from 'react'
// import { compose } from 'redux'
// import { devTools, persistState } from 'redux-devtools'
// import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
let finalCreateStore = compose(devTools(), persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)))(createStore)
let store = finalCreateStore(reducer)
console.log(process.env)
export let devToolElement = (
<DebugPanel top right bottom>
<DevTools store={store} monitor={LogMonitor} visibleOnLoad={false}/>
</DebugPanel>
)
var store, devToolEl
// if (process.env.NODE_ENV !== 'production') {
// let finalCreateStore = compose(devTools(), persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)))(createStore)
// let store = finalCreateStore(reducer)
// let store = createStore(reducer)
// devToolEl = (
// <DebugPanel top right bottom>
// <DevTools store={store} monitor={LogMonitor} visibleOnLoad={false}/>
// </DebugPanel>
// )
// } else {
// }
devToolEl = null
store = createStore(reducer)
export let devToolElement = devToolEl
export default store