From 2c751a8cd1e354b13cd5d70857ce0be3c81d8b6a Mon Sep 17 00:00:00 2001 From: Bu Kinoshita Date: Fri, 19 Jan 2018 16:53:41 -0200 Subject: [PATCH] skip onboard --- renderer/pages/start.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/renderer/pages/start.js b/renderer/pages/start.js index 19201a6..802c2b7 100644 --- a/renderer/pages/start.js +++ b/renderer/pages/start.js @@ -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) }