mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-09 21:06:37 +08:00
fixed language select not appearing for new users
This commit is contained in:
parent
dce3f852ea
commit
744ec677e4
1 changed files with 14 additions and 15 deletions
|
|
@ -373,23 +373,18 @@ export function reset() {
|
|||
}
|
||||
|
||||
export async function fillSettingsPage() {
|
||||
await initGroups();
|
||||
await UpdateConfig.loadPromise;
|
||||
ThemePicker.refreshButtons();
|
||||
|
||||
let languageEl = $(".pageSettings .section.language select").empty();
|
||||
Misc.getLanguageGroups().then((groups) => {
|
||||
groups.forEach((group) => {
|
||||
let append = `<optgroup label="${group.name}">`;
|
||||
group.languages.forEach((language) => {
|
||||
append += `<option value="${language}">${language.replace(
|
||||
/_/g,
|
||||
" "
|
||||
)}</option>`;
|
||||
});
|
||||
append += `</optgroup>`;
|
||||
languageEl.append(append);
|
||||
const groups = await Misc.getLanguageGroups();
|
||||
groups.forEach((group) => {
|
||||
let append = `<optgroup label="${group.name}">`;
|
||||
group.languages.forEach((language) => {
|
||||
append += `<option value="${language}">${language.replace(
|
||||
/_/g,
|
||||
" "
|
||||
)}</option>`;
|
||||
});
|
||||
append += `</optgroup>`;
|
||||
languageEl.append(append);
|
||||
});
|
||||
languageEl.select2();
|
||||
|
||||
|
|
@ -478,6 +473,10 @@ export async function fillSettingsPage() {
|
|||
$(".pageSettings .section.customLayoutfluid input").val(
|
||||
Config.customLayoutfluid.replace(/#/g, " ")
|
||||
);
|
||||
|
||||
await initGroups();
|
||||
await UpdateConfig.loadPromise;
|
||||
ThemePicker.refreshButtons();
|
||||
}
|
||||
|
||||
// export let settingsFillPromise = fillSettingsPage();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue