If you mix obedience with Riyaa your deed is ruined. Salvation lies with deeds without the desire for public recognition. Expect to meet your Lord with pure sincere deeds. Refer to Surah Al kahf verse 110. The wounds by the sword heals but the wounds by the tongue heal not. Rasulullah ﷺ would observe prolonged silence despite his infallibility.