Prevent js errors in the public share page for single files

js errors were introduced with the files sidebar

cc @PVince81 @DeepDiver1975