fix: properly set recentlyUsedPostLanguages to registry #2
1 changed files with 15 additions and 7 deletions
|
@ -1090,13 +1090,21 @@ async function post() {
|
||||||
const languages = Object.keys(langmap);
|
const languages = Object.keys(langmap);
|
||||||
const maxLength = 6;
|
const maxLength = 6;
|
||||||
|
|
||||||
defaultStore.state.recentlyUsedPostLanguages = [language.value]
|
defaultStore.set(
|
||||||
|
"recentlyUsedPostLanguages",
|
||||||
|
[language.value]
|
||||||
.concat(
|
.concat(
|
||||||
defaultStore.state.recentlyUsedPostLanguages.filter((lang) => {
|
defaultStore.state.recentlyUsedPostLanguages.filter(
|
||||||
return lang !== language.value && languages.includes(lang);
|
(lang) => {
|
||||||
}),
|
return (
|
||||||
|
lang !== language.value &&
|
||||||
|
languages.includes(lang)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.slice(0, maxLength);
|
.slice(0, maxLength),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue