Skip to content

Commit

Permalink
fix: popup显示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eeelester committed Sep 16, 2024
1 parent 0d62f9e commit 9ae5677
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion entrypoints/popup/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ function App() {
active: true,
currentWindow: true,
})
console.log('tab',tab)
setIsMatch(MATCH_URL.test(tab.url as string))
})()
}, [setIsMatch])

useLayoutEffect(() => {
(async () => {
console.log('changeIcon',isMatch)
if (!isMatch) {
changeIcon(false)
} else {
setSwitchState(await storage.getItem('session:switchState') ?? POPUP_INITIAL_STATE)
let tmp:boolean|null|undefined = await storage.getItem('session:switchState')
setSwitchState(tmp ?? POPUP_INITIAL_STATE)
}
})()
}, [isMatch])
Expand All @@ -42,6 +45,8 @@ function App() {

if (!switchState && prevSwitchState)
onSwitch(false)

console.log('switchState/prevSwitchState',switchState,prevSwitchState)
},[switchState])

return isMatch ? <Popup switchState={switchState} switchChange={setSwitchState}/> : <Wrong />
Expand Down
7 changes: 7 additions & 0 deletions wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ export default defineConfig({
runner: {
startUrls: ["https://live.bilibili.com/7777"],
},
hooks: {
build: {
manifestGenerated(_,manifest: any) {
manifest.action.default_title = '在B站看直播全屏时展示SC';
},
},
},
});

0 comments on commit 9ae5677

Please sign in to comment.