From e6597844f7e4364d6fd4ac3c1b5539b7eb6c42e4 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 26 Jun 2023 14:53:32 -0700 Subject: [PATCH] share: prevent init screen on shares (fix #562) Signed-off-by: Varun Patil --- lib/Controller/PublicAlbumController.php | 5 ++++- lib/Controller/PublicController.php | 5 ++++- src/App.vue | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Controller/PublicAlbumController.php b/lib/Controller/PublicAlbumController.php index 592af9cb..47261b99 100644 --- a/lib/Controller/PublicAlbumController.php +++ b/lib/Controller/PublicAlbumController.php @@ -76,7 +76,10 @@ class PublicAlbumController extends Controller if ($uid === $album['user'] || $this->albumsQuery->userIsCollaborator($uid, $albumId)) { $idStr = $album['user'].'/'.$album['name']; - $url = $this->urlGenerator->linkToRoute('memories.Page.albums', ['id' => $idStr]); + $url = $this->urlGenerator->linkToRoute('memories.Page.albums', [ + 'id' => $idStr, // id of album + 'noinit' => 1, // prevent showing first-start page + ]); return new RedirectResponse($url); } diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 36e9dae8..cef23329 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -209,7 +209,10 @@ class PublicController extends AuthPublicShareController $relPath = substr($relPath, \strlen($foldersPath)); // Redirect to the local path - $url = $this->urlGenerator->linkToRouteAbsolute('memories.Page.folder', ['path' => $relPath]); + $url = $this->urlGenerator->linkToRouteAbsolute('memories.Page.folder', [ + 'path' => $relPath, // path to folder + 'noinit' => 1, // prevent showing first-start page + ]); // Cannot send a redirect response here because the return // type is a template response for the base class diff --git a/src/App.vue b/src/App.vue index 8c21cac1..993b58f7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -184,8 +184,8 @@ export default defineComponent({ isFirstStart(): boolean { return ( this.config.timeline_path === 'EMPTY' && - this.$route.name !== 'folder-share' && - this.$route.name !== 'album-share' + !this.routeIsPublic && + !this.$route.query.noinit ); },