mirror of
https://example.com
synced 2024-11-22 12:16:40 +09:00
fix: properly set recentlyUsedPostLanguages to registry
This commit is contained in:
parent
887517d657
commit
2fe35019c8
1 changed files with 15 additions and 7 deletions
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue