From 14fca37e783a15f8f5f924d01efd0abc635ab827 Mon Sep 17 00:00:00 2001 From: Georgi Stamatov Date: Tue, 18 Apr 2023 20:17:25 +0300 Subject: [PATCH] Convert if/else add/remove statements to toggle --- src/components/nowPlayingBar/nowPlayingBar.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/nowPlayingBar/nowPlayingBar.js b/src/components/nowPlayingBar/nowPlayingBar.js index b25097e325..8ec7103fe3 100644 --- a/src/components/nowPlayingBar/nowPlayingBar.js +++ b/src/components/nowPlayingBar/nowPlayingBar.js @@ -336,11 +336,8 @@ import { appRouter } from '../appRouter'; toggleRepeatButton.classList.remove('hide'); } - if (supportedCommands.indexOf('AirPlay') === -1) { - toggleAirPlayButton.classList.add('hide'); - } else { - toggleAirPlayButton.classList.remove('hide'); - } + const hideAirPlayButton = supportedCommands.indexOf('AirPlay') === -1; + toggleAirPlayButton.classList.toggle('hide', hideAirPlayButton); updateRepeatModeDisplay(playbackManager.getRepeatMode()); onQueueShuffleModeChange();