diff --git a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/NewMeterWizard/AssetPage.tsx b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/NewMeterWizard/AssetPage.tsx index ac0394cd1..8dfeaf042 100644 --- a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/NewMeterWizard/AssetPage.tsx +++ b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/NewMeterWizard/AssetPage.tsx @@ -75,6 +75,11 @@ export default function AssetPage(props: IProps) { const [newEditAsset, setNewEditAsset] = React.useState(AssetAttributes.getNewAsset('Line')); const [editAssetKey, setEditAssetKey] = React.useState(''); const allAssetKeys = React.useMemo(() => detailedAssets.filter(a => a.ID !== newEditAsset.ID).map(a => a.AssetKey).concat(props.Assets.filter((a) => a.AssetKey !== editAssetKey).map(a => a.AssetKey)), [detailedAssets, props.Assets, newEditAsset.ID, editAssetKey]) + const filterChannels = React.useMemo(() => { + return props.Channels.filter(ch => + !(ch.Asset.length > 0) + ); + }, [props.Channels]); const [newEdit, setNewEdit] = React.useState<'New' | 'Edit'>('New'); const [showAssetModal, setShowAssetModal] = React.useState(false); @@ -275,12 +280,6 @@ export default function AssetPage(props: IProps) { return ; } - function filterChannels(chs: OpenXDA.Types.Channel[]) { - return chs.filter(ch => - !(ch.Asset.length > 0) - ); - } - return (
@@ -522,7 +521,7 @@ export default function AssetPage(props: IProps) {
{ setNewEditAsset((prev) => ({ ...prev, Channels: c })); @@ -539,7 +538,7 @@ export default function AssetPage(props: IProps) {
ch.ConnectionPriority == 0)} UpdateChannels={(c) => { let asset = _.clone(newEditAsset as OpenXDA.Types.Asset); @@ -557,7 +556,7 @@ export default function AssetPage(props: IProps) {
ch.ConnectionPriority == 1)} UpdateChannels={(c) => { let asset = _.clone(newEditAsset as OpenXDA.Types.Asset); @@ -578,7 +577,7 @@ export default function AssetPage(props: IProps) {
ch.ConnectionPriority == 0)} UpdateChannels={(c) => { let asset = _.clone(newEditAsset as OpenXDA.Types.Asset); @@ -596,7 +595,7 @@ export default function AssetPage(props: IProps) {
ch.ConnectionPriority == 1)} UpdateChannels={(c) => { let asset = _.clone(newEditAsset as OpenXDA.Types.Asset); @@ -614,7 +613,7 @@ export default function AssetPage(props: IProps) {
ch.ConnectionPriority == 2)} UpdateChannels={(c) => { let asset = _.clone(newEditAsset as OpenXDA.Types.Asset);