I was looking at a post, specifically this one:
I thought that the answer (the first reply) was a good one, so I clicked to "like". What I expected to happen was what I'd seen on other ones that I'd liked and that after a minute or so, the "like" text would change to "unlike". To my surprise, that text didn't change. Instead, the link that the user Ant-Green had posted as a solution to the original posters question had changed to say "unlike" and the link (for me) changed to the "unlike" link. I no longer could see the proper link.
I am using Chrome Version 91.0.4472.106 (Official Build) (64-bit). I am uncertain if this bug exists in other browsers.
Refreshing the page allows things to work as expected (like link is changed to unlike and Ant-Green's link to a solution returns).
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.