提交 b4105815 编写于 作者: D Dirk Baeumer

Fixes #66548: Avoid double async-calls

上级 bc6bc84e
...@@ -434,20 +434,16 @@ function getUserDefinedLocale() { ...@@ -434,20 +434,16 @@ function getUserDefinedLocale() {
} }
const localeConfig = path.join(userDataPath, 'User', 'locale.json'); const localeConfig = path.join(userDataPath, 'User', 'locale.json');
return exists(localeConfig).then((result) => { return bootstrap.readFile(localeConfig).then((content) => {
if (result) { content = stripComments(content);
return bootstrap.readFile(localeConfig).then((content) => { try {
content = stripComments(content); const value = JSON.parse(content).locale;
try { return value && typeof value === 'string' ? value.toLowerCase() : undefined;
const value = JSON.parse(content).locale; } catch (e) {
return value && typeof value === 'string' ? value.toLowerCase() : undefined;
} catch (e) {
return undefined;
}
});
} else {
return undefined; return undefined;
} }
}, () => {
return undefined;
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册