mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Double-check that post language and rtl property are set on publishing
This commit is contained in:
parent
c9df320ddd
commit
7ae7c57442
@ -83,6 +83,13 @@ extension WriteFreelyModel {
|
||||
func publish(post: WFAPost) {
|
||||
guard let loggedInClient = client else { return }
|
||||
|
||||
if post.language == nil {
|
||||
if let languageCode = Locale.current.languageCode {
|
||||
post.language = languageCode
|
||||
post.rtl = Locale.characterDirection(forLanguage: languageCode) == .rightToLeft
|
||||
}
|
||||
}
|
||||
|
||||
var wfPost = WFPost(
|
||||
body: post.body,
|
||||
title: post.title.isEmpty ? "" : post.title,
|
||||
|
Loading…
Reference in New Issue
Block a user