Previous selected tab as redux

This commit is contained in:
Shin'ya Ueoka 2018-05-06 16:11:40 +09:00
parent 98bc2326ee
commit 2c366ac3b1
8 changed files with 64 additions and 15 deletions

View file

@ -30,6 +30,8 @@ export default class BackgroundComponent {
// eslint-disable-next-line complexity
exec(operation, tab) {
let tabState = this.store.getState().tab;
switch (operation.type) {
case operations.TAB_CLOSE:
return tabs.closeTab(tab.id);
@ -46,7 +48,10 @@ export default class BackgroundComponent {
case operations.TAB_LAST:
return tabs.selectLastTab();
case operations.TAB_PREV_SEL:
return tabs.selectPrevSelTab();
if (tabState.previousSelected > 0) {
return tabs.selectTab(tabState.previousSelected);
}
break;
case operations.TAB_RELOAD:
return tabs.reload(tab, operation.cache);
case operations.TAB_PIN: