Skip to content

Commit

Permalink
add optional id param in customContent
Browse files Browse the repository at this point in the history
  • Loading branch information
alfianlosari committed Jun 8, 2024
1 parent 7196e50 commit c32325f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/ChatGPTUI/Models/MessageRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public struct MessageRow<CustomContent: View>: Identifiable {
public enum MessageRowType<CustomContent: View> {
case attributed(AttributedOutput)
case rawText(String)
case customContent(() -> CustomContent)
case customContent((_ messageRowId: UUID?) -> CustomContent)

public var text: String {
switch self {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChatGPTUI/Views/MessageRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public struct MessageRowView<CustomContent: View>: View {
}

case .customContent(let customViewProvider):
customViewProvider()
customViewProvider(message.id)
}

if let error = responseError {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChatGPTUI/Views/VoiceChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct VoiceChatView<CustomContent: View>: View {
}

case .customContent(let customViewProvider):
customViewProvider()
customViewProvider(nil)
}
}
}
Expand Down

0 comments on commit c32325f

Please sign in to comment.