mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-27 08:31:50 +00:00
before applying redux
This commit is contained in:
@@ -4,12 +4,12 @@ var mixin = {}
|
||||
|
||||
mixin.OnlyGuest = {
|
||||
componentDidMount: function () {
|
||||
var currentUser = localStorage.getItem('currentUser')
|
||||
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
||||
|
||||
if (currentUser == null) {
|
||||
return
|
||||
}
|
||||
this.transitionTo('userHome', {userName: currentUser.name})
|
||||
this.transitionTo('homeDefault')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ var md = markdownit({
|
||||
|
||||
var Markdown = {
|
||||
markdown: function (content) {
|
||||
if (content == null) content = ''
|
||||
return md.render(content)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var React = require('react/addons')
|
||||
import React from 'react'
|
||||
var ModalBase = React.createClass({
|
||||
getInitialState: function () {
|
||||
return {
|
||||
|
||||
@@ -21,11 +21,9 @@ function setPartialState (component, path, value) {
|
||||
updateIn(component.state, path, value))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
linkState: function (path) {
|
||||
return {
|
||||
value: getIn(this.state, path),
|
||||
requestChange: setPartialState.bind(null, this, path)
|
||||
}
|
||||
export default function linkState (path) {
|
||||
return {
|
||||
value: getIn(this.state, path),
|
||||
requestChange: setPartialState.bind(null, this, path)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user