Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 5abc514

Browse files
authored
Merge pull request #3765 from cezaraugusto/add-newtab-detail
add newTab page state
2 parents 3a28993 + 93591c0 commit 5abc514

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

docs/state.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ AppStore
189189
}],
190190
timestamp: number
191191
}
192+
},
193+
about: {
194+
newtab: {
195+
gridLayout: string // 'small', 'medium', 'large'
196+
}
192197
}
193198
}
194199
```

js/about/aboutActions.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ const AboutActions = {
124124
ipc.send(messages.SET_CLIPBOARD, text)
125125
},
126126

127+
setNewTabDetail: function (newTabPageDetail) {
128+
AboutActions.dispatchAction({
129+
actionType: AppConstants.APP_CHANGE_NEW_TAB_DETAIL,
130+
newTabPageDetail
131+
})
132+
},
133+
127134
deletePassword: function (password) {
128135
AboutActions.dispatchAction({
129136
actionType: AppConstants.APP_REMOVE_PASSWORD,

js/constants/appConstants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const AppConstants = {
4343
APP_SET_LOGIN_REQUIRED_DETAIL: _,
4444
APP_SET_LOGIN_RESPONSE_DETAIL: _,
4545
APP_WINDOW_BLURRED: _,
46-
APP_IDLE_STATE_CHANGED: _
46+
APP_IDLE_STATE_CHANGED: _,
47+
APP_CHANGE_NEW_TAB_DETAIL: _
4748
}
4849

4950
module.exports = mapValuesByKeys(AppConstants)

js/stores/appStore.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ const handleAppAction = (action) => {
396396
case AppConstants.APP_CLEAR_PASSWORDS:
397397
appState = appState.set('passwords', new Immutable.List())
398398
break
399+
case AppConstants.APP_CHANGE_NEW_TAB_DETAIL:
400+
appState = appState.setIn(['about', 'newtab'], action.newTabPageDetail)
401+
break
399402
case AppConstants.APP_ADD_SITE:
400403
const oldSiteSize = appState.get('sites').size
401404
if (action.siteDetail.constructor === Immutable.List) {

0 commit comments

Comments
 (0)