Skip to content

Commit

Permalink
Fixed a bug in upgrading popupServices settings #829
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Nov 19, 2023
1 parent c5e6201 commit 1a0e640
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"homepage": "https://libredirect.github.io",
"devDependencies": {
"web-ext": "^7.2.0",
"pug-cli": "^1.0.0-alpha6"
"pug-cli": "^1.0.0-alpha6",
"web-ext": "^7.2.0"
},
"webExt": {
"sourceDir": "./src/",
Expand All @@ -35,4 +35,4 @@
"overwriteDest": true
}
}
}
}
9 changes: 8 additions & 1 deletion src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ function redirect(url, type, initiator, forceRedirection) {
}
return `${randomInstance}`
}
case "twineo":
case "twineo":
case "safetwitch": {
if (url.hostname.startsWith("clips.")) {
return `${randomInstance}/clip${url.pathname}${url.search}`
Expand Down Expand Up @@ -804,6 +804,13 @@ function processUpdate() {
delete options[frontend]
}
}

for (const frontend of options.popupServices) {
if (!Object.keys(config.services).includes(frontend)) {
const i = options.popupServices.indexOf(frontend);
if (i > -1) options.popupServices.splice(i, 1);
}
}
}
browser.storage.local.set({ options }, () => {
resolve()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/options/widgets/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ resetSettings.addEventListener("click", async () => {
location.reload()
})

let fetchInstancesElement = document.getElementById('fetch-instances')
const fetchInstancesElement = document.getElementById('fetch-instances')
fetchInstancesElement.addEventListener('change', event => {
setOption('fetchInstances', 'select', event)
location.reload()
Expand Down

0 comments on commit 1a0e640

Please sign in to comment.