Fix top-level await
This commit is contained in:
parent
d605f4caca
commit
0b29b3dabd
1 changed files with 28 additions and 26 deletions
|
@ -4,6 +4,7 @@ export const supportsBrowserTranslator =
|
|||
// https://developer.chrome.com/docs/ai/language-detection
|
||||
export let langDetector;
|
||||
if (supportsBrowserTranslator) {
|
||||
(async () => {
|
||||
try {
|
||||
const languageDetectorCapabilities =
|
||||
await self.ai.languageDetector.capabilities();
|
||||
|
@ -31,6 +32,7 @@ if (supportsBrowserTranslator) {
|
|||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
// https://developer.chrome.com/docs/ai/translator-api
|
||||
|
|
Loading…
Add table
Reference in a new issue