diff options
-rw-r--r-- | apps/files/js/filelist.js | 9 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 6c86286d568..1f4d230cef0 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -599,9 +599,12 @@ */ _onGridviewChange: function() { var show = this.$showGridView.is(':checked'); - $.post(OC.generateUrl('/apps/files/api/v1/showgridview'), { - show: show - }); + // only save state if user is logged in + if (OC.currentUser) { + $.post(OC.generateUrl('/apps/files/api/v1/showgridview'), { + show: show + }); + } this.$showGridView.next('#view-toggle') .removeClass('icon-toggle-filelist icon-toggle-pictures') .addClass(show ? 'icon-toggle-filelist' : 'icon-toggle-pictures') diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 8e9cc5a9636..8d02cc82fd2 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -338,6 +338,7 @@ class ShareController extends AuthPublicShareController { $folder->assign('isPublic', true); $folder->assign('hideFileList', $hideFileList); $folder->assign('publicUploadEnabled', 'no'); + $folder->assign('showgridview', true); $folder->assign('uploadMaxFilesize', $maxUploadFilesize); $folder->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize)); $folder->assign('freeSpace', $freeSpace); |