You've already forked bilibili-subtitle
分离设置页面
This commit is contained in:
@@ -22,7 +22,8 @@ function App() {
|
||||
const eventBus = useContext(EventBusContext)
|
||||
const totalHeight = useAppSelector(state => state.env.totalHeight)
|
||||
const {sendInject} = useMessage()
|
||||
|
||||
const envData = useAppSelector(state => state.env.envData)
|
||||
|
||||
const foldCallback = useCallback(() => {
|
||||
dispatch(setFold(!fold))
|
||||
sendInject(MESSAGE_TO_INJECT_FOLD, {fold: !fold})
|
||||
@@ -37,6 +38,11 @@ function App() {
|
||||
}
|
||||
})
|
||||
|
||||
// theme改变时,设置主题
|
||||
useEffect(() => {
|
||||
setTheme(envData.theme)
|
||||
}, [envData.theme])
|
||||
|
||||
useSubtitleService()
|
||||
useTranslateService()
|
||||
useSearchService()
|
||||
|
Reference in New Issue
Block a user