ui: 修复部分情况下无法正常下载题目的问题

This commit is contained in:
undefined committed 2021-06-12 16:19:41 +08:00
1 parent 3ade228d47
commit 85def7213b
5 files changed
+11 -8

No files matched your search

@@ -80,7 +80,9 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
render() {
const LANGS = {};
const prefix = new Set(Object.keys(window.LANGS).filter((i) => i.includes('.')).map((i) => i.split('.')[0]));
for (const key in window.LANGS) {
if (prefix.has(key)) continue;
if (UiContext.pdoc.config.langs && !UiContext.pdoc.config.langs.includes(key)) continue;
LANGS[key] = window.LANGS[key];
}