mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-05 00:19:59 +00:00
fix: default user language when writing a publication (#1446)
This commit is contained in:
parent
255c341a78
commit
adb17d7f14
1 changed files with 11 additions and 1 deletions
|
@ -33,7 +33,7 @@ export function getDefaultDraft(options: Partial<Mutable<mastodon.v1.CreateStatu
|
|||
visibility: visibility || 'public',
|
||||
sensitive: sensitive ?? false,
|
||||
spoilerText: spoilerText || '',
|
||||
language: language || 'en',
|
||||
language: language || getDefaultLanguage(),
|
||||
},
|
||||
mentions,
|
||||
lastUpdated: Date.now(),
|
||||
|
@ -52,6 +52,16 @@ export async function getDraftFromStatus(status: mastodon.v1.Status): Promise<Dr
|
|||
})
|
||||
}
|
||||
|
||||
function getDefaultLanguage() {
|
||||
const userSettings = useUserSettings()
|
||||
const defaultLanguage = userSettings.value.language
|
||||
|
||||
if (defaultLanguage)
|
||||
return defaultLanguage.split('-')[0]
|
||||
|
||||
return 'en'
|
||||
}
|
||||
|
||||
function getAccountsToMention(status: mastodon.v1.Status) {
|
||||
const userId = currentUser.value?.account.id
|
||||
const accountsToMention = new Set<string>()
|
||||
|
|
Loading…
Reference in a new issue