getRerenderAwareArray = (oldArray, newArray) => {
  if (oldArray.length !== newArray.length) return newArray
  const diff = oldArray.filter((i) => !newArray.includes(i))

  return diff.length > 0 ? newArray : oldArray
}
Returns the oldArray (ideally from the store) if it is the same as the newArray so that the store is not updated
This is to prevent the store from being updated with the same data, which would cause a re-render

@fixes https://github.com/ipfs/ipfs-webui/issues/2080
@param {any[]} oldArray
@param {any[]} newArray
@returns {any[]} oldArray or newArray