From 986ea0691d1ac31949b3fdf4dfe9866a4c1e4008 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 13 Apr 2023 15:03:19 -0400 Subject: [PATCH] Use Promise the way they are meant to be used --- src/js/traffic.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/traffic.js b/src/js/traffic.js index a3ac407ab..1e9d4f7b9 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -1136,10 +1136,10 @@ const webRequest = { vAPI.defer.once({ min: 1 }).then(( ) => { if ( vAPI.net.hasUnprocessedRequest() === false ) { return; } vAPI.net.removeUnprocessedRequest(); - vAPI.tabs.getCurrent().then(tab => { - if ( tab === null ) { return; } - µb.updateToolbarIcon(tab.id, 0b0110); - }); + return vAPI.tabs.getCurrent(); + }).then(tab => { + if ( tab instanceof Object === false ) { return; } + µb.updateToolbarIcon(tab.id, 0b0110); }); vAPI.net.unsuspend({ all: true }); };