Skip to content

Commit 0064d39

Browse files
authored
Merge pull request #329 from alpheios-project/comp-i662-lexical-dicts
Fix attach multiple times bug
2 parents 02170b6 + 05f0603 commit 0064d39

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

src/background/background-process.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,6 @@ export default class BackgroundProcess {
575575
this.setBadgeState()
576576
}
577577

578-
definedWindowIdByTabNum (tabId) {
579-
let savedTab
580-
581-
for (let i = 0; i < this.tabs.size; i++) {
582-
const tabsIter = this.tabs.values()
583-
const tabInstance = tabsIter.next().value
584-
if (tabInstance.tabObj && tabInstance.tabObj.tabId === tabId) {
585-
savedTab = tabInstance
586-
}
587-
}
588-
return savedTab ? savedTab.tabObj.windowId : 1
589-
}
590-
591578
/**
592579
* Called when a page is loaded.
593580
* Use this to listen on webNavigation.onCompleted rather than tabs.onUpdated
@@ -598,8 +585,9 @@ export default class BackgroundProcess {
598585
* @param details
599586
* @return {Promise.<void>}
600587
*/
601-
async navigationCompletedListener (tabId) {
602-
const finalWindowId = this.definedWindowIdByTabNum(tabId)
588+
async navigationCompletedListener (tabId, changeInfo, tab) {
589+
if (changeInfo.status !== 'complete') { return }
590+
const finalWindowId = tab.windowId
603591
const tmpTabUniqueId = Tab.createUniqueId(tabId, finalWindowId)
604592

605593
if (this.tabs.has(tmpTabUniqueId)) {

src/safari-app-extension/AlpheiosReadingTools/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleShortVersionString</key>
2222
<string>3.4.1</string>
2323
<key>CFBundleVersion</key>
24-
<string>incr-3.4.x.20211117323</string>
24+
<string>comp-i662-lexical-dicts.20211118643</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.education</string>
2727
<key>LSMinimumSystemVersion</key>

src/safari-app-extension/AlpheiosSafari/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundleShortVersionString</key>
1818
<string>3.4.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>incr-3.4.x.20211117323</string>
20+
<string>comp-i662-lexical-dicts.20211118643</string>
2121
<key>LSMinimumSystemVersion</key>
2222
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2323
<key>NSExtension</key>

0 commit comments

Comments
 (0)