Assalamu alaikkum sheikh If simeone does an act in the prayer for the people to see(riya)and then after doing that he finds its shirk al asghar and stop it and then he continue tge salah normallly is prayer invalidated?

Ustadh AbdulAziz al-Haqqan
Do you suffer from OCD, waswas?