Skip to content

Commit

Permalink
Merge pull request #78 from Chaphasilor/dev
Browse files Browse the repository at this point in the history
Update from dev
  • Loading branch information
Chaphasilor authored Aug 2, 2021
2 parents b5278ee + 4ddf004 commit 7ba0350
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions public/netlify-functions/checkLinkAlive.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ const fetchTimeout = (url, ms, options = {}) => {
return promise.finally(() => clearTimeout(timeout));
};

function encodeUriOnce(url, useURIComponent = false) {

let decoder = useURIComponent ? decodeURIComponent : decodeURI
while(url !== decoder(url)) {
url = decoder(url);
}

return encodeURI(url);

}

function resolveLink(url) {

let resolvedUrl = url;
let resolvedUrl = encodeUriOnce(url);
let resolvedHeaders = {};

if (url.includes(`driveindex.ga/`)) {
Expand All @@ -48,7 +59,7 @@ function checkLink(urlData) {
return new Promise((resolve) => {

const startTime = performance.now()
urlData.url = encodeURI(urlData.url);
urlData.url = encodeUriOnce(urlData.url);

fetchTimeout(urlData.url, REQUEST_TIMEOUT, {
method: `HEAD`,
Expand Down
4 changes: 2 additions & 2 deletions src/components/SearchField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@
<div
class="flex flex-row px-2 py-1 m-1 text-green-900 border border-green-900 rounded-sm dark:border-green-400 dark:text-green-100 hover:cursor-pointer"
:class="
presetState(preset.keywords, option.keywords) === `all` ? `bg-green-600` :
presetState(preset.keywords, option.keywords) === `some` ? `bg-green-900` :
presetState(preset.keywords, option.keywords) === `all` ? `bg-green-300 dark:bg-green-600` :
presetState(preset.keywords, option.keywords) === `some` ? `bg-green-100 dark:bg-green-900` :
`bg-transparent`
"
@mouseup="togglePreset(preset, option.keywords)"
Expand Down
2 changes: 1 addition & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default new Vuex.Store({
},
{
name: `eBooks`,
keywords: [`epub`, `pdf`, `mobi`, `azw`],
keywords: [`epub`, `pdf`, `mobi`, `azw`, `azw3`, `cbr`, `iba`],
},
],
}
Expand Down

0 comments on commit 7ba0350

Please sign in to comment.