fix: bing dict
This commit is contained in:
@@ -140,7 +140,7 @@ export const apiMicrosoftDict = async (text) => {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(str, "text/html");
|
||||
|
||||
const word = doc.querySelector("#headword > h1").textContent.trim();
|
||||
const word = doc.querySelector("#headword > h1")?.textContent.trim();
|
||||
if (!word) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ function DictBody({ text, setCopyText, setRealWord, dict }) {
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return <Typography>Empty result</Typography>;
|
||||
return <Typography>Not found!</Typography>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user