Skip to content

Commit

Permalink
Merge pull request #299 from jdi-testing/issue_260
Browse files Browse the repository at this point in the history
fix tab update
  • Loading branch information
MariiaNebesnova authored Aug 20, 2021
2 parents b40144c + 3fdfe56 commit 1300efd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "JDN",
"description": "",
"devtools_page": "index.html",
"version": "3.0.41",
"version": "3.0.42",
"permissions": [
"activeTab",
"tabs",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdi-react-extension",
"version": "3.0.41",
"version": "3.0.42",
"description": "jdi react extension",
"scripts": {
"start": "npm run webpack",
Expand Down
5 changes: 3 additions & 2 deletions src/js/blocks/autoFind/autoFindProvider/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Connector {
constructor() {
this.tab = null;
this.port = null;
this.getPageId();
this.getTab();

this.onerror = null;
}
Expand All @@ -12,7 +12,7 @@ class Connector {
else throw error;
}

getPageId() {
getTab() {
chrome.tabs.query({ active: true, currentWindow: true }, (res) => {
if (res && res[0]) this.tab = res[0];
else this.handleError("Connector: active page id is not available.");
Expand Down Expand Up @@ -43,6 +43,7 @@ class Connector {
changeinfo.status === "complete" &&
this.tab.id === tabId
) {
this.getTab();
if (this.port) {
this.port.disconnect();
this.port = null;
Expand Down
2 changes: 1 addition & 1 deletion src/js/blocks/autoFind/tests/autoFind.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("AutoFind Identify functionality", () => {
);

jest.clearAllMocks();
jest.spyOn(connector, "getPageId").mockReturnValue(
jest.spyOn(connector, "getTab").mockReturnValue(
(() => {
connector.tab = { id: "42" };
})()
Expand Down

0 comments on commit 1300efd

Please sign in to comment.