Skip to content

Commit 449ffa3

Browse files
committed
TODOs
1 parent 7007750 commit 449ffa3

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

VoiceAgent/Agent/AgentSession.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ final class AgentSession: ObservableObject {
116116
}
117117

118118
let connection = { @Sendable in
119-
let (server, token) = try! await self.credentials()
119+
let (server, token) = try await self.credentials()
120120
try await self.room.connect(url: server, token: token, connectOptions: options, roomOptions: roomOptions)
121121
}
122122

VoiceAgent/App/AppView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ struct AppView: View {
5151
@ViewBuilder
5252
private func start() -> some View {
5353
StartView()
54+
.onAppear {
55+
chat = false
56+
}
5457
}
5558

5659
@ViewBuilder

VoiceAgent/Auth/Sandbox.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ enum Sandbox {
1212
struct Connection: Decodable {
1313
let serverUrl: String
1414
let participantToken: String
15+
let roomName: String
16+
let participantName: String
1517
}
1618

1719
private static let url: String = "https://cloud-api.livekit.io/api/sandbox/connection-details"
1820

21+
// TODO: These are not respected anyway (names)
1922
static func getConnection(id: String, roomName: String, participantName: String) async throws -> Connection {
2023
var urlComponents = URLComponents(string: url)!
2124
urlComponents.queryItems = [

VoiceAgent/Chat/View/ChatScrollView.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,22 @@ struct ChatScrollView<Content: View>: View {
2121
scrollView.scrollTo(session.messages.keys.last)
2222
}
2323
.upsideDown()
24-
.padding(.horizontal)
2524
.scrollIndicators(.never)
2625
.animation(.default, value: session.messages)
2726
}
2827
}
2928
}
29+
30+
private struct UpsideDown: ViewModifier {
31+
func body(content: Content) -> some View {
32+
content
33+
.rotationEffect(.radians(Double.pi))
34+
.scaleEffect(x: -1, y: 1, anchor: .center)
35+
}
36+
}
37+
38+
private extension View {
39+
func upsideDown() -> some View {
40+
modifier(UpsideDown())
41+
}
42+
}

VoiceAgent/Chat/View/ChatView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ struct ChatView: View {
55

66
var body: some View {
77
ChatScrollView(messageBuilder: message)
8+
.padding(.horizontal)
89
}
910

1011
@ViewBuilder

VoiceAgent/Helpers/View+.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import SwiftUI
22

3-
/// A view modifier that flips the view upside down.
4-
/// It may be used to create e.g. an inverted List.
5-
/// - SeeAlso: ``ChatView``
6-
struct UpsideDown: ViewModifier {
7-
func body(content: Content) -> some View {
8-
content
9-
.rotationEffect(.radians(Double.pi))
10-
.scaleEffect(x: -1, y: 1, anchor: .center)
11-
}
12-
}
13-
143
/// A view modifier that slightly blurs the top of the view.
154
struct BlurredTop: ViewModifier {
165
func body(content: Content) -> some View {
@@ -50,11 +39,6 @@ struct Shimerring: ViewModifier {
5039
}
5140

5241
extension View {
53-
/// Flips the view upside down.
54-
func upsideDown() -> some View {
55-
modifier(UpsideDown())
56-
}
57-
5842
/// Blurs the top of the view.
5943
func blurredTop() -> some View {
6044
modifier(BlurredTop())

0 commit comments

Comments
 (0)