pull/5370/head
yann300 3 years ago
parent f8989c663f
commit 3959e1bb57
  1. 39
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx

@ -28,9 +28,7 @@ export const AssemblyItems = ({ registerEvent }) => {
}
}, [assemblyItems.opCodes.index])
const clearItems = () => {
let currentItem = refs.current[selectedItem] ? refs.current[selectedItem] : null
let clearItem = (currentItem) => {
if (currentItem) {
currentItem.removeAttribute('selected')
currentItem.removeAttribute('style')
@ -38,43 +36,20 @@ export const AssemblyItems = ({ registerEvent }) => {
currentItem.firstChild.removeAttribute('style')
}
}
currentItem = refs.current[nextSelectedItem] ? refs.current[nextSelectedItem] : null
if (currentItem) {
currentItem.removeAttribute('selected')
currentItem.removeAttribute('style')
if (currentItem.firstChild) {
currentItem.firstChild.removeAttribute('style')
}
}
const clearItems = () => {
clearItem(refs.current[selectedItem] ? refs.current[selectedItem] : null)
clearItem(refs.current[nextSelectedItem] ? refs.current[nextSelectedItem] : null)
returnInstructionIndexes.map((index) => {
if (index < 0) return
currentItem = refs.current[index] ? refs.current[index] : null
if (currentItem) {
currentItem.removeAttribute('selected')
currentItem.removeAttribute('style')
if (currentItem.firstChild) {
currentItem.firstChild.removeAttribute('style')
}
}
clearItem(refs.current[index] ? refs.current[index] : null)
})
outOfGasInstructionIndexes.map((index) => {
if (index < 0) return
currentItem = refs.current[index] ? refs.current[index] : null
if (currentItem) {
currentItem.removeAttribute('selected')
currentItem.removeAttribute('style')
if (currentItem.firstChild) {
currentItem.firstChild.removeAttribute('style')
}
}
clearItem(refs.current[index] ? refs.current[index] : null)
})
}

Loading…
Cancel
Save