File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Examples/SyncUps/SyncUps/Dependencies Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,12 @@ extension SpeechClient: DependencyKey {
3333 }
3434
3535 static var previewValue : SpeechClient {
36- let isRecording = LockIsolated ( false )
37- return Self (
36+ Self (
3837 authorizationStatus: { . authorized } ,
3938 requestAuthorization: { . authorized } ,
4039 startTask: { _ in
4140 AsyncThrowingStream { continuation in
4241 Task { @MainActor in
43- isRecording. setValue ( true )
4442 var finalText = """
4543 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor \
4644 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud \
@@ -50,7 +48,7 @@ extension SpeechClient: DependencyKey {
5048 officia deserunt mollit anim id est laborum.
5149 """
5250 var text = " "
53- while isRecording . value {
51+ while !finalText . isEmpty {
5452 let word = finalText. prefix { $0 != " " }
5553 try await Task . sleep ( for: . milliseconds( word. count * 50 + . random( in: 0 ... 200 ) ) )
5654 finalText. removeFirst ( word. count)
You can’t perform that action at this time.
0 commit comments