mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-18 05:20:43 +01:00
Merge pull request #5141 from nextcloud/backport/5116/stable29
[stable29] fix: Pass document target through viewer component
This commit is contained in:
commit
f15504abc5
2 changed files with 14 additions and 1 deletions
|
|
@ -406,8 +406,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) {
|
||||
|
|
|
|||
|
|
@ -340,6 +340,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue