mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #47841 from nextcloud/fix/files-sharing-openfile
fix(files_sharing): Open single-file-share by default
This commit is contained in:
commit
0e4438fc04
4 changed files with 15 additions and 3 deletions
|
|
@ -77,6 +77,7 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider
|
|||
$view = 'public-share';
|
||||
if ($shareNode instanceof File) {
|
||||
$view = 'public-file-share';
|
||||
$this->initialState->provideInitialState('fileId', $shareNode->getId());
|
||||
} elseif (($share->getPermissions() & \OCP\Constants::PERMISSION_CREATE)
|
||||
&& !($share->getPermissions() & \OCP\Constants::PERMISSION_READ)
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -22,3 +22,14 @@ navigation.setActive(navigation.views.find(({ id }) => id === view) ?? null)
|
|||
// Force our own router
|
||||
window.OCP.Files = window.OCP.Files ?? {}
|
||||
window.OCP.Files.Router = new RouterService(router)
|
||||
|
||||
// If this is a single file share, so set the fileid as active in the URL
|
||||
const fileId = loadState<number|null>('files_sharing', 'fileId', null)
|
||||
const token = loadState<string>('files_sharing', 'sharingToken')
|
||||
if (fileId !== null) {
|
||||
window.OCP.Files.Router.goToRoute(
|
||||
'filelist',
|
||||
{ ...window.OCP.Files.Router.params, token, fileid: String(fileId) },
|
||||
{ ...window.OCP.Files.Router.query, openfile: 'true' },
|
||||
)
|
||||
}
|
||||
|
|
|
|||
4
dist/files_sharing-init-public.js
vendored
4
dist/files_sharing-init-public.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-init-public.js.map
vendored
2
dist/files_sharing-init-public.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue