Skip to content

Commit

Permalink
fix: exclusive access
Browse files Browse the repository at this point in the history
  • Loading branch information
ddddxxx committed Oct 8, 2019
1 parent e07582a commit 160205a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LyricsX/Component/AppController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class AppController: NSObject {
($0?.$currentTrack).map(AnyPublisher.init) ?? Just(nil).eraseToAnyPublisher()
}
.switchToLatest()
.receive(on: DispatchQueue.global().cx)
.sink { [unowned self] track in
self.currentTrackChanged(track: track)
}
Expand All @@ -82,6 +83,7 @@ class AppController: NSObject {
($0?.$playbackState).map(AnyPublisher.init) ?? Just(.stopped).eraseToAnyPublisher()
}
.switchToLatest()
.receive(on: DispatchQueue.global().cx)
.sink { [unowned self] state in
self.scheduleCurrentLineCheck(playbackTime: state.time)
}
Expand Down

0 comments on commit 160205a

Please sign in to comment.