From f993467015f9a09ee4b4de5d9f45482bd6f6fcd7 Mon Sep 17 00:00:00 2001 From: sup39 Date: Wed, 27 Dec 2023 21:07:20 +0900 Subject: [PATCH] fix: properly set recentlyUsedPostLanguages to registry --- packages/client/src/components/MkPostForm.vue | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 65528e24..1b364bf1 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -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), + ); } } -- 2.47.1