Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2021-07-18 12:34:23 +0300
committerJulius Härtl <jus@bitgrid.net>2021-07-19 09:18:20 +0300
commitcbd6c912e48ba99bd169e9fb0e53c99364682d55 (patch)
tree4e670f256a7ebe5308abd3bf0690ccf802ece50d /src
parentff201056c04e52cad52c47bafd7707de9a1bdfdb (diff)
Update use of `OCA.Viewer` api to the nextcloud 22 version
Looks like the [accessor to state] was removed from the Viewer api and replaced with [separate getters]. So we need to replace `OCA.Viewer.state.file` with `OCA.Viewer.file`. Fixes #1676 [accessor to state]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1L52-L63) [separate getters]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1R79-R81) Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/helpers/links.js2
-rw-r--r--src/tests/helpers/links.spec.js4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/helpers/links.js b/src/helpers/links.js
index 5d7ecbf7e..18f556b5c 100644
--- a/src/helpers/links.js
+++ b/src/helpers/links.js
@@ -58,7 +58,7 @@ const domHref = function(node) {
const match = ref.match(/^([^?]*)\?fileId=(\d+)/)
if (match) {
const [, relPath, id] = match
- const currentDir = basedir(OCA.Viewer.state.file)
+ const currentDir = basedir(OCA.Viewer.file)
const dir = absolutePath(currentDir, basedir(relPath))
return generateUrl(`/apps/files/?dir=${dir}&openfile=${id}#relPath=${relPath}`)
}
diff --git a/src/tests/helpers/links.spec.js b/src/tests/helpers/links.spec.js
index 426d80f6a..d881b2897 100644
--- a/src/tests/helpers/links.spec.js
+++ b/src/tests/helpers/links.spec.js
@@ -2,9 +2,7 @@ import { domHref, parseHref } from '../../helpers/links'
global.OCA = {
Viewer: {
- state: {
- file: '/Wiki/file.md',
- },
+ file: '/Wiki/file.md',
},
}