Skip to content

Commit 9175db1

Browse files
authored
Merge pull request #5139 from nextcloud/backport/5116/stable31
2 parents 09f8b96 + 45f31e2 commit 9175db1

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

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

403+
$params = [
404+
'urlSrc' => $this->tokenManager->getUrlSrc($file)
405+
];
406+
407+
$targetData = $this->session->get(self::SESSION_FILE_TARGET);
408+
if ($targetData) {
409+
$this->session->remove(self::SESSION_FILE_TARGET);
410+
if ($targetData['fileId'] === $fileId) {
411+
$params['target'] = $targetData['target'];
412+
}
413+
}
414+
403415
return new DataResponse(array_merge(
404-
[ 'urlSrc' => $this->tokenManager->getUrlSrc($file) ],
416+
$params,
405417
$wopi->jsonSerialize(),
406418
));
407419
} 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)