File tree 1 file changed +2
-4
lines changed
Examples/SyncUps/SyncUps/Dependencies
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,12 @@ extension SpeechClient: DependencyKey {
33
33
}
34
34
35
35
static var previewValue : SpeechClient {
36
- let isRecording = LockIsolated ( false )
37
- return Self (
36
+ Self (
38
37
authorizationStatus: { . authorized } ,
39
38
requestAuthorization: { . authorized } ,
40
39
startTask: { _ in
41
40
AsyncThrowingStream { continuation in
42
41
Task { @MainActor in
43
- isRecording. setValue ( true )
44
42
var finalText = """
45
43
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor \
46
44
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud \
@@ -50,7 +48,7 @@ extension SpeechClient: DependencyKey {
50
48
officia deserunt mollit anim id est laborum.
51
49
"""
52
50
var text = " "
53
- while isRecording . value {
51
+ while !finalText . isEmpty {
54
52
let word = finalText. prefix { $0 != " " }
55
53
try await Task . sleep ( for: . milliseconds( word. count * 50 + . random( in: 0 ... 200 ) ) )
56
54
finalText. removeFirst ( word. count)
You can’t perform that action at this time.
0 commit comments