fix: type error

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-10-10 14:39:41 +08:00
parent 86ce165717
commit afb7997de2
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ export const readerRoute = {
if (!window) {
return
}
return callWindowExpose(window).toast.error(error.message, {
void callWindowExpose(window).toast.error(error.message, {
duration: 1000,
})
}
@@ -57,6 +57,9 @@ export const ShikiHighLighter: FC<ShikiProps> = (props) => {
function guessLanguage() {
return tipcClient?.detectCodeStringLanguage({ codeString: code }).then((result) => {
if (!result) {
return
}
if (bundledLanguagesKeysSet?.has(result.languageId)) {
setCurrentLanguage(result.languageId)
}