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 20, 2023
1 parent 133836d commit e15f894
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,26 +641,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 e15f894

Please sign in to comment.