Skip to content

Commit 8b368e8

Browse files
committed
Rename ChatRoom to ChatProvider
1 parent 07b7f02 commit 8b368e8

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Core/Sources/SuggestionWidget/ChatRoom.swift renamed to Core/Sources/SuggestionWidget/ChatProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public final class ChatRoom: ObservableObject, Equatable {
3+
public final class ChatProvider: ObservableObject, Equatable {
44
@Published public var history: [ChatMessage] = []
55
@Published public var isReceivingMessage = false
66
public var onMessageSend: (String) -> Void
@@ -24,7 +24,7 @@ public final class ChatRoom: ObservableObject, Equatable {
2424
self.onClose = onClose
2525
}
2626

27-
public static func == (lhs: ChatRoom, rhs: ChatRoom) -> Bool {
27+
public static func == (lhs: ChatProvider, rhs: ChatProvider) -> Bool {
2828
lhs.history == rhs.history && lhs.isReceivingMessage == rhs.isReceivingMessage
2929
}
3030

Core/Sources/SuggestionWidget/SuggestionPanelContent/ChatPanel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33

44
struct ChatPanel: View {
55
@ObservedObject var viewModel: SuggestionPanelViewModel
6-
@ObservedObject var chat: ChatRoom
6+
@ObservedObject var chat: ChatProvider
77
@Namespace var inputAreaNamespace
88
@State var typedMessage = ""
99

@@ -30,7 +30,7 @@ struct ChatPanel: View {
3030
}
3131

3232
struct ChatPanelToolbar: View {
33-
let chat: ChatRoom
33+
let chat: ChatProvider
3434

3535
var body: some View {
3636
HStack {
@@ -52,7 +52,7 @@ struct ChatPanelToolbar: View {
5252
}
5353

5454
struct ChatPanelMessages: View {
55-
@ObservedObject var chat: ChatRoom
55+
@ObservedObject var chat: ChatProvider
5656
var inputAreaNamespace: Namespace.ID
5757
var colorScheme: ColorScheme
5858
@AppStorage(\.disableLazyVStack) var disableLazyVStack
@@ -174,7 +174,7 @@ struct ChatPanelMessages: View {
174174
}
175175

176176
struct ChatPanelInputArea: View {
177-
@ObservedObject var chat: ChatRoom
177+
@ObservedObject var chat: ChatProvider
178178
var inputAreaNamespace: Namespace.ID
179179
@Binding var typedMessage: String
180180
@FocusState var isInputAreaFocused: Bool

Core/Sources/SuggestionWidget/SuggestionPanelView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class SuggestionPanelViewModel: ObservableObject {
3333
}
3434
}
3535

36-
@Published var chat: ChatRoom? {
36+
@Published var chat: ChatProvider? {
3737
didSet {
3838
adjustActiveTabAndShowHideIfNeeded(tab: .chat)
3939
}
@@ -57,7 +57,7 @@ final class SuggestionPanelViewModel: ObservableObject {
5757

5858
public init(
5959
content: Content? = nil,
60-
chat: ChatRoom? = nil,
60+
chat: ChatProvider? = nil,
6161
isPanelDisplayed: Bool = false,
6262
activeTab: ActiveTab = .suggestion,
6363
colorScheme: ColorScheme = .dark,

0 commit comments

Comments
 (0)