Skip to content

Commit

Permalink
fix: Update isPlaying on main thread
Browse files Browse the repository at this point in the history
- 뷰와 관련된 published 프로퍼티의 값 변경을 메인 스레드에서 하도록 수정
  • Loading branch information
zaehorang committed Sep 6, 2024
1 parent d9d075e commit 633049d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MinGenie/MinGenie/Playback/MusicPlayerModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ final class MusicPlayerModel: ObservableObject {
}

private func handlePlaybackStateDidChange() {
isPlaying = (musicPlayer.state.playbackStatus == .playing)
DispatchQueue.main.async {
self.isPlaying = (self.musicPlayer.state.playbackStatus == .playing)
}
}

}

0 comments on commit 633049d

Please sign in to comment.