Skip to content

Commit 56ec8a4

Browse files
authored
Merge pull request #92 from janLo/fix-issue-90-sharingToken
fix: Get the sharing token the new way
2 parents c064eb2 + bd3ec8f commit 56ec8a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@nextcloud/files": "^3.0.0",
1919
"@nextcloud/l10n": "^2.2.0",
2020
"@nextcloud/router": "^2.1.2",
21+
"@nextcloud/sharing": "^0.2.3",
2122
"jquery": "^3.7.0",
2223
"path": "^0.12.7",
2324
"process": "^0.11.10"

src/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
**/
99

1010
import { generateUrl } from '@nextcloud/router'
11+
import { getSharingToken } from '@nextcloud/sharing/public'
1112
import * as $ from 'jquery';
1213
import { translate as t } from '@nextcloud/l10n'
1314
import { showError } from '@nextcloud/dialogs'
@@ -159,7 +160,7 @@ OCA.DrawIO = {
159160
{
160161
var fileName = $('#filename').val();
161162
var mimeType = $('#mimetype').val();
162-
var sharingToken = $('#sharingToken').val();
163+
var sharingToken = getSharingToken();
163164
var extension = fileName.substr(fileName.lastIndexOf('.') + 1).toLowerCase();
164165
var isWB = String(extension == 'dwb');
165166

@@ -208,4 +209,4 @@ OCA.DrawIO = {
208209
$(function ()
209210
{
210211
OCA.DrawIO.init();
211-
});
212+
});

0 commit comments

Comments
 (0)