Skip to content

Commit

Permalink
use execute tab
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Sep 16, 2023
1 parent a2e49e4 commit 9b56004
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/PanelFixCSR.vue
Expand Up @@ -110,20 +110,25 @@ async function fix() {

// eslint-disable-next-line functional/no-loop-statements
for (let i = 0; i < ids.length; i++) {
const url = urls[i]
const chapId = url.match(/(\d+)\/?$/)?.[1]

const [$data, $season] = groupedResolvedUndef[i]
const [data, season] = [
const [data, ep] = [
JSON.parse($data!),
$season ? JSON.parse($season) : undefined,
$season && chapId ? JSON.parse($season).chaps.find(chap=>{
return chap.id === chapId
}) : undefined,
]

const title = season
const title = ep
? t("tap-_chap-_name-_othername", [
season.name,
ep.name,
data.name,
data.othername,
])
: t("_name-_othername", [data.name, data.othername])
await Client.execTabs("update", [ids[i], { title }])
await Client.execTabs("executeScript", [ids[i], { code:`document.title=${JSON.stringify(title)}` }])
}

fixing.value = false
Expand Down

0 comments on commit 9b56004

Please sign in to comment.