We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5aaa4ff commit ac3d15aCopy full SHA for ac3d15a
1 file changed
lib/index.ts
@@ -1,17 +1,18 @@
1
-/**
+/*!
2
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
3
* SPDX-License-Identifier: GPL-3.0-or-later
4
*/
5
+
6
import { loadState } from '@nextcloud/initial-state'
7
8
export function getCapabilities(): Object {
9
try {
10
return loadState('core', 'capabilities')
11
} catch (error) {
12
console.debug('Could not find capabilities initial state fall back to _oc_capabilities')
- if (!('_oc_capabilities' in window)) {
13
+ if (!('_oc_capabilities' in globalThis)) {
14
return {}
15
}
- return window['_oc_capabilities'] as Object
16
+ return globalThis['_oc_capabilities'] as Object
17
18
0 commit comments