diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 5a4cdb505217ebc0d609dcd5ddfd754db50c4eb0..d9d64d96a0bb0b245bd6d47674415cc3849792b8 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -17,6 +17,20 @@ $(document).ready(function() {
 					}
 				}
 			});
+			$.ajax({
+				type: 'GET',
+				url: OC.linkTo('files_publiclink', 'ajax/getlink.php'),
+				dataType: 'json',
+				data: 'path='+file,
+				async: false,
+				success: function(link) {
+					if (link.length > 0) {
+						icon = OC.imagePath('core', 'actions/public');
+					} else {
+						icon = OC.imagePath('core', 'actions/share');
+					}
+				}
+			});
 			return icon;
 		}, function(filename) {
 			if (($('#dropdown').length > 0)) {