Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Show current device in device list

Render all devices (including the current one) and disable click
actions/hover styling for the current device. Update title and
placeholder
text accordingly

+14 -12
+14 -12
webui/rockbox/src/Components/ControlBar/DeviceList/DeviceList.tsx
··· 137 137 castDevices.find((d) => d.isCurrentDevice) ?? 138 138 null; 139 139 140 - // Show all other devices in the list. 141 - const otherDevices = castDevices.filter((d) => !d.isCurrentDevice); 142 - 143 140 return ( 144 141 <Container> 145 142 {/* Current device header */} ··· 167 164 )} 168 165 </CurrentDeviceWrapper> 169 166 170 - {!loading && otherDevices.length > 0 && ( 171 - <Title>Switch output device</Title> 167 + {!loading && castDevices.length > 0 && ( 168 + <Title>Output device</Title> 172 169 )} 173 170 174 171 <List> 175 - {otherDevices.length === 0 && !loading && ( 172 + {castDevices.length === 0 && !loading && ( 176 173 <Placeholder> 177 - No other devices found. Make sure your devices are on the same 178 - network. 174 + No devices found. Make sure your devices are on the same network. 179 175 </Placeholder> 180 176 )} 181 - {otherDevices.map((device) => ( 177 + {castDevices.map((device) => ( 182 178 <div 183 179 key={device.id} 184 - onClick={() => _onConnectToCastDevice(device.id)} 180 + onClick={() => { 181 + if (!device.isCurrentDevice) { 182 + _onConnectToCastDevice(device.id); 183 + } 184 + }} 185 185 > 186 186 <ListItem 187 187 artwork={() => ( ··· 193 193 overrides={{ 194 194 Root: { 195 195 style: { 196 - cursor: "pointer", 196 + cursor: device.isCurrentDevice ? "default" : "pointer", 197 197 backgroundColor: "transparent", 198 198 ":hover": { 199 - backgroundColor: theme.colors.hover, 199 + backgroundColor: device.isCurrentDevice 200 + ? "transparent" 201 + : theme.colors.hover, 200 202 }, 201 203 borderRadius: "5px", 202 204 },