From e0bff54a827bcf15931ed651d4a5279b352a2961 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 3 Sep 2017 16:13:02 +0900 Subject: use promise and show errors --- src/background/zooms.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/background/zooms.js') diff --git a/src/background/zooms.js b/src/background/zooms.js index bb65030..e3e2aa6 100644 --- a/src/background/zooms.js +++ b/src/background/zooms.js @@ -10,7 +10,7 @@ const ZOOM_SETTINGS = [ ]; const zoomIn = (tabId = undefined) => { - browser.tabs.getZoom(tabId).then((factor) => { + return browser.tabs.getZoom(tabId).then((factor) => { for (let f of ZOOM_SETTINGS) { if (f > factor) { browser.tabs.setZoom(tabId, f); @@ -21,7 +21,7 @@ const zoomIn = (tabId = undefined) => { }; const zoomOut = (tabId = undefined) => { - browser.tabs.getZoom(tabId).then((factor) => { + return browser.tabs.getZoom(tabId).then((factor) => { for (let f of [].concat(ZOOM_SETTINGS).reverse()) { if (f < factor) { browser.tabs.setZoom(tabId, f); @@ -32,7 +32,7 @@ const zoomOut = (tabId = undefined) => { }; const neutral = (tabId = undefined) => { - browser.tabs.setZoom(tabId, 1); + return browser.tabs.setZoom(tabId, 1); }; export { zoomIn, zoomOut, neutral }; -- cgit v1.2.3