Skip to content

Commit 822ce36

Browse files
committed
Update LMViewModel.swift
1 parent a947431 commit 822ce36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/d3-async-location/viewmodel/LMViewModel.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ public final class LMViewModel: ILocationManagerViewModel{
3333
private var state : LocationStreamingState = .idle
3434

3535
/// Check if streaming is idle
36+
@MainActor
3637
private var isIdle: Bool{
37-
state == .idle
38+
return state == .idle
3839
}
3940

4041
// MARK: - Life circle
@@ -79,8 +80,7 @@ public final class LMViewModel: ILocationManagerViewModel{
7980

8081
/// Start streaming locations
8182
public func start() async throws{
82-
83-
guard isIdle else{
83+
guard await isIdle else{
8484
throw AsyncLocationErrors.streamingProcessHasAlreadyStarted
8585
}
8686

0 commit comments

Comments
 (0)