From 8db779388f260631286332aec6cb6a448a29d791 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Fri, 13 Jul 2018 21:59:23 +0900 Subject: Fix error on no completion items --- src/console/reducers/index.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/console') diff --git a/src/console/reducers/index.js b/src/console/reducers/index.js index 71b0776..043689c 100644 --- a/src/console/reducers/index.js +++ b/src/console/reducers/index.js @@ -11,6 +11,9 @@ const defaultState = { }; const nextSelection = (state) => { + if (state.completions.length === 0) { + return [-1, -1]; + }; if (state.groupSelection < 0) { return [0, 0]; } -- cgit v1.2.3 From ccc6a31ddeab78660305d9088e8260156b251779 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Fri, 13 Jul 2018 22:09:04 +0900 Subject: fix --- src/background/shared/completions/index.js | 2 +- src/console/reducers/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/console') diff --git a/src/background/shared/completions/index.js b/src/background/shared/completions/index.js index 4fd37fd..d0d00ef 100644 --- a/src/background/shared/completions/index.js +++ b/src/background/shared/completions/index.js @@ -130,7 +130,7 @@ const complete = (line, settings) => { let name = words[0]; if (words.length === 1) { let items = completeCommands(name); - if (items.length === 0) { + if (items.length === 0) { return Promise.resolve([]); } return Promise.resolve([ diff --git a/src/console/reducers/index.js b/src/console/reducers/index.js index 043689c..7dcad17 100644 --- a/src/console/reducers/index.js +++ b/src/console/reducers/index.js @@ -13,7 +13,7 @@ const defaultState = { const nextSelection = (state) => { if (state.completions.length === 0) { return [-1, -1]; - }; + } if (state.groupSelection < 0) { return [0, 0]; } -- cgit v1.2.3