Skip to content
Permalink
Browse files

v2.1.1

  • Loading branch information
rafaelgssa committed Dec 28, 2019
2 parents f623149 + 020b138 commit 91ec1d1d43e736af728a0fcc14abe73c81d4ce81
Showing with 9 additions and 5 deletions.
  1. +1 −1 package-lock.json
  2. +1 −1 package.json
  3. +3 −0 src/class/Request.js
  4. +4 −3 src/modules/background/index.js

Some generated files are not rendered by default. Learn more.

@@ -1,6 +1,6 @@
{
"name": "traktflix",
"version": "2.1.0",
"version": "2.1.1",
"description": "A Trakt.tv scrobbler for Netflix.",
"author": "tegon",
"private": true,
@@ -7,6 +7,9 @@ class Request {
if (!Shared.isBackgroundPage() && !options.url.match(location.host)) {
try {
const response = await browser.runtime.sendMessage({ type: `request`, options: JSON.stringify(options) });
if (response.error) {
throw response;
}
options.success(response);
} catch (error) {
options.error(error.status, error.responseText, error.options);
@@ -38,7 +38,7 @@ if (chrome && chrome.declarativeContent) {
}

browser.runtime.onMessage.addListener((request, sender) => {
return new Promise(async (resolve, reject) => {
return new Promise(async resolve => {
switch (request.type) {
case `getApiDefs`:
// noinspection JSIgnoredPromiseFromCall
@@ -113,8 +113,9 @@ browser.runtime.onMessage.addListener((request, sender) => {
try {
const response = await Request.sendAndWait(options);
resolve(response);
} catch (error) {
reject(error);
} catch (response) {
response.error = true;
resolve(response);
}
return;
}

0 comments on commit 91ec1d1

Please sign in to comment.
You can’t perform that action at this time.