You've already forked bilibili-subtitle
优化
This commit is contained in:
@@ -2,9 +2,9 @@ import { setCurFetched, setCurInfo, setData, setInfos, setTitle, setUrl } from '
|
||||
import { useMemo } from 'react'
|
||||
import { useAppDispatch } from './redux'
|
||||
import { MESSAGE_TO_APP_SET_INFOS, MESSAGE_TO_APP_SET_VIDEO_INFO } from '@/consts/const'
|
||||
import useMessageService from '@/messaging/layer2/useMessageService'
|
||||
import useMessagingService from '@/messaging/layer2/useMessagingService'
|
||||
|
||||
const useMessagingService = () => {
|
||||
const useMessageService = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
//methods
|
||||
@@ -25,7 +25,7 @@ const useMessagingService = () => {
|
||||
},
|
||||
}), [dispatch])
|
||||
|
||||
useMessageService(methods)
|
||||
useMessagingService(methods)
|
||||
}
|
||||
|
||||
export default useMessagingService
|
||||
export default useMessageService
|
@@ -2,7 +2,7 @@ import {useAppDispatch, useAppSelector} from './redux'
|
||||
import React, {useCallback} from 'react'
|
||||
import {setNeedScroll, setReviewAction, setTempData} from '../redux/envReducer'
|
||||
import {MESSAGE_TO_INJECT_MOVE} from '../consts/const'
|
||||
import useMessage from '../messaging/layer2/useMessage'
|
||||
import useMessage from '../messaging/layer2/useMessaging'
|
||||
const useSubtitle = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
const reviewed = useAppSelector(state => state.env.tempData.reviewed)
|
||||
|
@@ -20,8 +20,8 @@ import {EVENT_EXPAND, GEMINI_TOKENS, TOTAL_HEIGHT_MAX, TOTAL_HEIGHT_MIN, WORDS_M
|
||||
import {useAsyncEffect, useInterval} from 'ahooks'
|
||||
import {getModelMaxTokens, getWholeText} from '../utils/biz_util'
|
||||
import {MESSAGE_TO_INJECT_GET_SUBTITLE} from '../consts/const'
|
||||
import useMessage from '../messaging/layer2/useMessage'
|
||||
import { msgWaiter } from '@/messaging/layer2/useMessageService'
|
||||
import useMessage from '../messaging/layer2/useMessaging'
|
||||
import { msgWaiter } from '@/messaging/layer2/useMessagingService'
|
||||
|
||||
/**
|
||||
* Service是单例,类似后端的服务概念
|
||||
|
@@ -31,7 +31,7 @@ import toast from 'react-hot-toast'
|
||||
import {useMemoizedFn} from 'ahooks/es'
|
||||
import {extractJsonArray, extractJsonObject, getModel} from '../utils/biz_util'
|
||||
import {formatTime} from '../utils/util'
|
||||
import useMessage from '@/messaging/layer2/useMessage'
|
||||
import useMessaging from '@/messaging/layer2/useMessaging'
|
||||
const useTranslate = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
const data = useAppSelector(state => state.env.data)
|
||||
@@ -45,7 +45,7 @@ const useTranslate = () => {
|
||||
const reviewed = useAppSelector(state => state.env.tempData.reviewed)
|
||||
const reviewAction = useAppSelector(state => state.env.reviewAction)
|
||||
const reviewActions = useAppSelector(state => state.env.tempData.reviewActions)
|
||||
const {sendExtension} = useMessage()
|
||||
const {sendExtension} = useMessaging()
|
||||
/**
|
||||
* 获取下一个需要翻译的行
|
||||
* 会检测冷却
|
||||
|
Reference in New Issue
Block a user