Fixing hooks order
This commit is contained in:
@ -167,6 +167,10 @@ const Group = ({
|
||||
|
||||
const Outputs = () => {
|
||||
const snapcastEnabled = useSelector((state) => state.snapcast.enabled);
|
||||
const allGroups = indexToArray(useSelector((state) => state.snapcast.groups || {}));
|
||||
const allStreams = useSelector((state) => state.snapcast.streams || {});
|
||||
const allServers = indexToArray(useSelector((state) => state.mopidy.servers || {}));
|
||||
const groupsByStream = groupBy(allGroups, 'stream_id');
|
||||
if (!snapcastEnabled) {
|
||||
return (
|
||||
<p className="no-results">
|
||||
@ -175,11 +179,6 @@ const Outputs = () => {
|
||||
);
|
||||
}
|
||||
|
||||
const allGroups = indexToArray(useSelector((state) => state.snapcast.groups || {}));
|
||||
const allStreams = useSelector((state) => state.snapcast.streams || {});
|
||||
const allServers = indexToArray(useSelector((state) => state.mopidy.servers || {}));
|
||||
const groupsByStream = groupBy(allGroups, 'stream_id');
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
{map(groupsByStream, (groups, id) => {
|
||||
|
||||
Reference in New Issue
Block a user