This commit is contained in:
Thomas Ricouard 2024-01-10 07:28:08 +01:00
parent 1c1a612d56
commit f758b672f1

View file

@ -220,21 +220,24 @@ extension StatusEditor {
switch mode { switch mode {
case .new, .replyTo, .quote, .mention, .shareExtension: case .new, .replyTo, .quote, .mention, .shareExtension:
postStatus = try await client.post(endpoint: Statuses.postStatus(json: data)) postStatus = try await client.post(endpoint: Statuses.postStatus(json: data))
if let postStatus {
StreamWatcher.shared.emmitPostEvent(for: postStatus)
}
case let .edit(status): case let .edit(status):
postStatus = try await client.put(endpoint: Statuses.editStatus(id: status.id, json: data)) postStatus = try await client.put(endpoint: Statuses.editStatus(id: status.id, json: data))
if let postStatus {
StreamWatcher.shared.emmitEditEvent(for: postStatus)
}
} }
postingTimer?.invalidate() postingTimer?.invalidate()
postingTimer = nil postingTimer = nil
if let postStatus { withAnimation {
withAnimation { postingProgress = 99.0
postingProgress = 99.0
}
try await Task.sleep(for: .seconds(0.5))
StreamWatcher.shared.emmitEditEvent(for: postStatus)
HapticManager.shared.fireHaptic(.notification(.success))
} }
try await Task.sleep(for: .seconds(0.5))
HapticManager.shared.fireHaptic(.notification(.success))
if hasExplicitlySelectedLanguage, let selectedLanguage { if hasExplicitlySelectedLanguage, let selectedLanguage {
preferences?.markLanguageAsSelected(isoCode: selectedLanguage) preferences?.markLanguageAsSelected(isoCode: selectedLanguage)