Fix last tab is undefined
This commit is contained in:
parent
b3dafedf88
commit
691e9ca8f2
3 changed files with 13 additions and 2 deletions
|
@ -10,6 +10,10 @@ export default class MemoryStorage {
|
|||
}
|
||||
|
||||
get(name) {
|
||||
return JSON.parse(db[name]);
|
||||
let data = db[name];
|
||||
if (!data) {
|
||||
return undefined;
|
||||
}
|
||||
return JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue