This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9480 from cezaraugusto/about/firstrun
Make welcome screen show up on first time run
- Loading branch information
1 parent
e55134b
commit 76f1648
Showing
11 changed files
with
193 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
'use strict' | ||
|
||
const appConstants = require('../../../js/constants/appConstants') | ||
const {makeImmutable} = require('../../common/state/immutableUtil') | ||
|
||
const aboutWelcomeReducer = (state, action, immutableAction) => { | ||
action = immutableAction || makeImmutable(action) | ||
switch (action.get('actionType')) { | ||
case appConstants.APP_ACTIVATE_WELCOME_SCREEN: | ||
state = state.setIn(['about', 'welcome', 'showOnLoad'], action.get('activateWelcomeScreen')) | ||
break | ||
} | ||
return state | ||
} | ||
|
||
module.exports = aboutWelcomeReducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* global describe, it, before, after */ | ||
const mockery = require('mockery') | ||
const Immutable = require('immutable') | ||
const assert = require('assert') | ||
const appConstants = require('../../../../../js/constants/appConstants') | ||
const fakeElectron = require('../../../lib/fakeElectron') | ||
|
||
require('../../../braveUnit') | ||
|
||
describe('aboutWelcomeReducer', function () { | ||
let aboutWelcomeReducer | ||
|
||
before(function () { | ||
mockery.enable({ | ||
warnOnReplace: false, | ||
warnOnUnregistered: false, | ||
useCleanCache: true | ||
}) | ||
mockery.registerMock('electron', fakeElectron) | ||
aboutWelcomeReducer = require('../../../../../app/browser/reducers/aboutWelcomeReducer') | ||
}) | ||
|
||
after(function () { | ||
mockery.disable() | ||
}) | ||
|
||
describe('APP_ACTIVATE_WELCOME_SCREEN', function () { | ||
before(function () { | ||
this.newState = aboutWelcomeReducer(Immutable.Map(), { | ||
actionType: appConstants.APP_ACTIVATE_WELCOME_SCREEN, | ||
activateWelcomeScreen: false | ||
}) | ||
}) | ||
it('can set visibility state to false', function () { | ||
assert.equal(this.newState.getIn(['about', 'welcome', 'showOnLoad']), false) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters