()
| 85 | } |
| 86 | |
| 87 | export const loadNewServiceInfo = (): void => { |
| 88 | if (!isMemberVipAndKey()) { |
| 89 | return |
| 90 | } |
| 91 | const key = cacheGet('translateServiceKey') |
| 92 | findNewByInfo({ |
| 93 | key: key |
| 94 | }).then((data: any) => { |
| 95 | const translateInfo = data?.translateInfo |
| 96 | if (isNotNull(translateInfo)) { |
| 97 | setTranslateServiceMap(new Map(JSON.parse(translateInfo.info))) |
| 98 | // 更新翻译源通知 |
| 99 | window.api.updateTranslateServiceNotify() |
| 100 | } else { |
| 101 | saveServiceInfoHandle(ServiceTypeEnum.TRANSLATE) |
| 102 | } |
| 103 | const ocrInfo = data?.ocrInfo |
| 104 | if (isNotNull(ocrInfo)) { |
| 105 | setOcrServiceMap(new Map(JSON.parse(ocrInfo.info))) |
| 106 | } else { |
| 107 | saveServiceInfoHandle(ServiceTypeEnum.OCR) |
| 108 | } |
| 109 | const refreshServiceInfoNotifyFun = window.api['refreshServiceInfoNotify'] |
| 110 | if (isNotNull(refreshServiceInfoNotifyFun)) { |
| 111 | refreshServiceInfoNotifyFun() |
| 112 | } |
| 113 | }) |
| 114 | } |
nothing calls this directly
no test coverage detected