[wip] remove STATE_UPDATE

This commit is contained in:
Shin'ya Ueoka 2017-10-06 23:55:52 +09:00
parent 10ad62e606
commit 4cb17031d1
6 changed files with 31 additions and 32 deletions

View file

@ -55,17 +55,12 @@ const execOperation = (operation) => {
}
};
const update = (state) => {
if (!state.console.commandShown) {
window.focus();
consoleFrames.blur(window.document);
}
};
browser.runtime.onMessage.addListener((action) => {
switch (action.type) {
case messages.STATE_UPDATE:
return update(action.state);
case messages.CONSOLE_HIDE:
window.focus();
consoleFrames.blur(window.document);
return Promise.resolve();
case messages.CONTENT_OPERATION:
execOperation(action.operation);
return Promise.resolve();