fix: default user language when writing a publication (#1446)
parent
255c341a78
commit
adb17d7f14
|
@ -33,7 +33,7 @@ export function getDefaultDraft(options: Partial<Mutable<mastodon.v1.CreateStatu
|
||||||
visibility: visibility || 'public',
|
visibility: visibility || 'public',
|
||||||
sensitive: sensitive ?? false,
|
sensitive: sensitive ?? false,
|
||||||
spoilerText: spoilerText || '',
|
spoilerText: spoilerText || '',
|
||||||
language: language || 'en',
|
language: language || getDefaultLanguage(),
|
||||||
},
|
},
|
||||||
mentions,
|
mentions,
|
||||||
lastUpdated: Date.now(),
|
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) {
|
function getAccountsToMention(status: mastodon.v1.Status) {
|
||||||
const userId = currentUser.value?.account.id
|
const userId = currentUser.value?.account.id
|
||||||
const accountsToMention = new Set<string>()
|
const accountsToMention = new Set<string>()
|
||||||
|
|
Loading…
Reference in New Issue