I don’t know that he was saying never pray publicly, just don’t do it if you are only doing to be seen doing it.
Even so, that is what they were doing; or if it was not, it is unclear that it was not. Which makes it a bad idea either way and means it still is relevant.