Skip to content

Commit b563278

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
fix: Pass document target through viewer component
Signed-off-by: Julius Knorr <jus@bitgrid.net>
1 parent fee67ae commit b563278

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
@@ -401,8 +401,20 @@ public function token(int $fileId, ?string $shareToken = null, ?string $path = n
401401

402402
$this->tokenManager->setGuestName($wopi, $guestName);
403403

404+
$params = [
405+
'urlSrc' => $this->tokenManager->getUrlSrc($file)
406+
];
407+
408+
$targetData = $this->session->get(self::SESSION_FILE_TARGET);
409+
if ($targetData) {
410+
$this->session->remove(self::SESSION_FILE_TARGET);
411+
if ($targetData['fileId'] === $fileId) {
412+
$params['target'] = $targetData['target'];
413+
}
414+
}
415+
404416
return new DataResponse(array_merge(
405-
[ 'urlSrc' => $this->tokenManager->getUrlSrc($file) ],
417+
$params,
406418
$wopi->jsonSerialize(),
407419
));
408420
} catch (Exception $e) {

src/view/Office.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ export default {
332332
revisionHistory: !this.isPublic,
333333
closeButton: !Config.get('hideCloseButton') && !this.isEmbedded,
334334
startPresentation: Config.get('startPresentation'),
335+
target: data.target,
335336
})
336337
this.$set(this.formData, 'action', action)
337338
this.$set(this.formData, 'accessToken', data.token)

0 commit comments

Comments
 (0)