aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-28 17:06:20 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-07-28 17:10:08 +0900
commit691e9ca8f28a8430e4765ab1a9ae13687289a53b (patch)
treee464cbed67281469841c04908196939cb449597f /src/background/usecases
parentb3dafedf8819d79fbcdb19ea0a9de4ff102b7f55 (diff)
Fix last tab is undefined
Diffstat (limited to 'src/background/usecases')
-rw-r--r--src/background/usecases/operation.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/background/usecases/operation.js b/src/background/usecases/operation.js
index f19c632..86f39ca 100644
--- a/src/background/usecases/operation.js
+++ b/src/background/usecases/operation.js
@@ -183,7 +183,9 @@ export default class OperationInteractor {
onTabSelected(tabId) {
let lastId = this.cache.get(CURRENT_SELECTED_KEY);
- this.cache.set(LAST_SELECTED_KEY, lastId);
+ if (lastId) {
+ this.cache.set(LAST_SELECTED_KEY, lastId);
+ }
this.cache.set(CURRENT_SELECTED_KEY, tabId);
}
}