don't show share dialog and navigation entry if sharing was disabled for the user

don't show share dialog and navigation entry if sharing was disabled for the user, fix #10273 

cc @icewind1991 please have a look at it, thanks!