fix: Pass document target through viewer component

Signed-off-by: Julius Knorr <jus@bitgrid.net>
This commit is contained in:
Julius Knorr 2025-10-22 14:36:24 +02:00
parent ed3b2889e6
commit 41510fadf3
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
2 changed files with 14 additions and 1 deletions

View file

@ -400,8 +400,20 @@ class DocumentController extends Controller {
$this->tokenManager->setGuestName($wopi, $guestName);
$params = [
'urlSrc' => $this->tokenManager->getUrlSrc($file)
];
$targetData = $this->session->get(self::SESSION_FILE_TARGET);
if ($targetData) {
$this->session->remove(self::SESSION_FILE_TARGET);
if ($targetData['fileId'] === $fileId) {
$params['target'] = $targetData['target'];
}
}
return new DataResponse(array_merge(
[ 'urlSrc' => $this->tokenManager->getUrlSrc($file) ],
$params,
$wopi->jsonSerialize(),
));
} catch (Exception $e) {

View file

@ -325,6 +325,7 @@ export default {
readOnly: forceReadOnly || version > 0,
revisionHistory: !this.isPublic,
closeButton: !Config.get('hideCloseButton') && !this.isEmbedded,
target: data.target,
})
this.$set(this.formData, 'action', action)
this.$set(this.formData, 'accessToken', data.token)