fix: properly set recentlyUsedPostLanguages to registry #2

Manually merged
sup39 merged 1 commit from fix/update-post-recent-lang into main 2023-12-28 11:04:16 +09:00

View file

@ -1090,13 +1090,21 @@ async function post() {
const languages = Object.keys(langmap);
const maxLength = 6;
defaultStore.state.recentlyUsedPostLanguages = [language.value]
.concat(
defaultStore.state.recentlyUsedPostLanguages.filter((lang) => {
return lang !== language.value && languages.includes(lang);
}),
)
.slice(0, maxLength);
defaultStore.set(
"recentlyUsedPostLanguages",
[language.value]
.concat(
defaultStore.state.recentlyUsedPostLanguages.filter(
(lang) => {
return (
lang !== language.value &&
languages.includes(lang)
);
},
),
)
.slice(0, maxLength),
);
}
}