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

Fixes #66548: Avoid double async-calls

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