Skip to content

Commit 649496a

Browse files
committed
fix: Pass document target through viewer component
Signed-off-by: Julius Knorr <[email protected]>
1 parent 98460e8 commit 649496a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/Controller/DocumentController.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,20 @@ public function token(int $fileId, ?string $shareToken = null, ?string $path = n
406406

407407
$this->tokenManager->setGuestName($wopi, $guestName);
408408

409+
$params = [
410+
'urlSrc' => $this->tokenManager->getUrlSrc($file)
411+
];
412+
413+
$targetData = $this->session->get(self::SESSION_FILE_TARGET);
414+
if ($targetData) {
415+
$this->session->remove(self::SESSION_FILE_TARGET);
416+
if ($targetData['fileId'] === $fileId) {
417+
$params['target'] = $targetData['target'];
418+
}
419+
}
420+
409421
return new DataResponse(array_merge(
410-
[ 'urlSrc' => $this->tokenManager->getUrlSrc($file) ],
422+
$params,
411423
$wopi->jsonSerialize(),
412424
));
413425
} catch (Exception $e) {

src/view/Office.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ export default {
340340
readOnly: forceReadOnly || version > 0,
341341
revisionHistory: !this.isPublic,
342342
closeButton: !Config.get('hideCloseButton') && !this.isEmbedded,
343+
target: data.target,
343344
})
344345
this.$set(this.formData, 'action', action)
345346
this.$set(this.formData, 'accessToken', data.token)

0 commit comments

Comments
 (0)