Skip to content

Commit

Permalink
Add fix for #940 (IOS-2)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Feb 25, 2023
1 parent e3bb527 commit 31beb03
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,26 +639,24 @@ extension ComposeContentViewModel {

// save language to recent languages
if let settings = context.settingService.currentSetting.value {
Task.detached(priority: .background) { [language] in
try await settings.managedObjectContext?.performChanges {
settings.recentLanguages = [language] + settings.recentLanguages.filter { $0 != language }
}
settings.managedObjectContext?.performAndWait {
settings.recentLanguages = [language] + settings.recentLanguages.filter { $0 != language }
}
}

return MastodonEditStatusPublisher(statusID: status.id,
author: author,
isContentWarningComposing: isContentWarningActive,
contentWarning: contentWarning,
content: content,
isMediaSensitive: isContentWarningActive,
attachmentViewModels: attachmentViewModels,
isPollComposing: isPollActive,
pollOptions: pollOptions,
pollExpireConfigurationOption: pollExpireConfigurationOption,
pollMultipleConfigurationOption: pollMultipleConfigurationOption,
visibility: visibility,
language: language)
author: author,
isContentWarningComposing: isContentWarningActive,
contentWarning: contentWarning,
content: content,
isMediaSensitive: isContentWarningActive,
attachmentViewModels: attachmentViewModels,
isPollComposing: isPollActive,
pollOptions: pollOptions,
pollExpireConfigurationOption: pollExpireConfigurationOption,
pollMultipleConfigurationOption: pollMultipleConfigurationOption,
visibility: visibility,
language: language)
}

}
Expand Down

0 comments on commit 31beb03

Please sign in to comment.