FIX: Sharing link stood visible after using browser’s back button

This small piece of code fixes this bug: https://meta.discourse.org/t/dialog-for-sharing-link-stays-visible-after-using-browsers-back-and-forward-buttons/22178

;)