Skip to content

Commit

Permalink
skip onboard
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita committed Feb 13, 2018
1 parent a543fa8 commit 2c751a8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion renderer/pages/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ import Row from './../components/row'

// Services
import { getCookie } from './../services/cookies'
import { getUser, updateUser } from './../services/local-storage'

// Theme
import { colors, typography } from './../theme'

class Start extends Component {
componentDidMount() {
const { user } = getUser()
const cfg = remote && remote.app ? remote.app.config : {}
const token = getCookie('taskr')
const redirectUrl = cfg.user.pro && token ? '/home?tab=Today' : '/onboard'
const { pro } = cfg.user
const skipOnboard = user.onboard ? '/home?tab=Today' : '/onboard'
const redirectUrl = pro && token ? '/home?tab=Today' : skipOnboard

if (!user.onboard) {
const userUpdated = Object.assign(user, { onboard: true })

updateUser(userUpdated)
}

Router.push(redirectUrl)
}
Expand Down

0 comments on commit 2c751a8

Please sign in to comment.