This code only works some on the time. It would be much better for UNA to code this into the share options.
it has been a request since UNA 9.0 so we may need to wait for many more releases before the UNA team can include it as a priority.
https://una.io/page.php?i=item&id=40621