Small fixes for other errors

This commit is contained in:
bourquecharles
2021-05-20 21:22:44 -04:00
parent 726be1c31b
commit ef856947b4
2 changed files with 4 additions and 7 deletions

View File

@@ -67,7 +67,7 @@ const DeviceCommands = ({selectedDeviceId}) => {
};
const toggleDetails = (item, index) => {
if(item.command !== 'wifiscan'){
if(item.command !== 'wifiscan' || !item.results.status){
const position = details.indexOf(index);
let newDetails = details.slice();
@@ -91,10 +91,6 @@ const DeviceCommands = ({selectedDeviceId}) => {
}
const getDetails = (command, commandDetails) => {
if (command === 'wifiscan') {
return null;
}
if (command === 'reboot' || command === 'leds'){
const result = commandDetails.results;
if(result)

View File

@@ -3,6 +3,7 @@ import {
CRow
} from '@coreui/react';
import React from 'react';
import { v4 as createUuid } from 'uuid';
import WifiChannelCard from './WifiChannelCard';
const WifiChannelTable = ({channels}) => (
@@ -10,7 +11,7 @@ const WifiChannelTable = ({channels}) => (
<CCol>
{
channels.map((channel, index) => {
if(index % 2 === 0) return <WifiChannelCard channel={channel}/>;
if(index % 2 === 0) return <WifiChannelCard key={createUuid()} channel={channel}/>;
return <></>
})
}
@@ -18,7 +19,7 @@ const WifiChannelTable = ({channels}) => (
<CCol>
{
channels.map((channel, index) => {
if(index % 2 === 1) return <WifiChannelCard channel={channel}/>;
if(index % 2 === 1) return <WifiChannelCard key={createUuid()} channel={channel}/>;
return <></>
})
}