Skip to content

Commit

Permalink
Remove double sonos prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Sep 2, 2021
1 parent b7963e7 commit 4348b3c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/scala/com/kubukoz/next/SpotifyChoice.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ object SpotifyChoice {
val spotifyInstanceF = lastSonosRoom.set(None).as(Choice.Spotify)

val sonosInstanceF: F[Option[Choice]] = {
val fetchZones: F[Option[sonos.SonosZones]] =
UserOutput[F].print(UserMessage.CheckingSonos) *>
SonosInfo[F].zones

def extractRoom(zones: sonos.SonosZones): F[String] = {
val roomName = zones.zones.head.coordinator.roomName

Expand All @@ -54,7 +50,7 @@ object SpotifyChoice {
val roomF: F[Option[String]] =
OptionT(lastSonosRoom.get)
.orElse(
OptionT(fetchZones).semiflatMap(extractRoom)
OptionT(SonosInfo[F].zones).semiflatMap(extractRoom)
)
.value

Expand Down

0 comments on commit 4348b3c

Please sign in to comment.