From 04c780270de33d5dc2343249d3ec1842b717a311 Mon Sep 17 00:00:00 2001 From: victordelva Date: Wed, 25 Jan 2023 14:06:49 +0100 Subject: [PATCH 1/2] fix default user language when writing a publication in spanish make it work for all languages --- composables/masto/statusDrafts.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/composables/masto/statusDrafts.ts b/composables/masto/statusDrafts.ts index 9729800f0b..2bc480d3c5 100644 --- a/composables/masto/statusDrafts.ts +++ b/composables/masto/statusDrafts.ts @@ -33,7 +33,7 @@ export function getDefaultDraft(options: Partial() From e8ade7ce4b32f60c0303da962d826b5933b39736 Mon Sep 17 00:00:00 2001 From: victor del Date: Wed, 25 Jan 2023 14:55:00 +0100 Subject: [PATCH 2/2] refactor --- composables/masto/statusDrafts.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composables/masto/statusDrafts.ts b/composables/masto/statusDrafts.ts index 2bc480d3c5..567eb0172f 100644 --- a/composables/masto/statusDrafts.ts +++ b/composables/masto/statusDrafts.ts @@ -56,7 +56,10 @@ function getDefaultLanguage() { const userSettings = useUserSettings() const defaultLanguage = userSettings.value.language - return defaultLanguage.split('-')[0] || 'en' + if (defaultLanguage) + return defaultLanguage.split('-')[0] + + return 'en' } function getAccountsToMention(status: mastodon.v1.Status) {