File tree 4 files changed +9
-9
lines changed
4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { logger } from "../src/logger";
20
20
// try to load the olm library.
21
21
try {
22
22
// eslint-disable-next-line @typescript-eslint/no-var-requires
23
- global . Olm = require ( "@matrix-org/olm" ) ;
23
+ globalThis . Olm = require ( "@matrix-org/olm" ) ;
24
24
logger . log ( "loaded libolm" ) ;
25
25
} catch ( e ) {
26
26
logger . warn ( "unable to run crypto tests: libolm not available" , e ) ;
Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ declare global {
24
24
/* eslint-enable no-var */
25
25
}
26
26
27
- if ( global . __js_sdk_entrypoint ) {
27
+ if ( globalThis . __js_sdk_entrypoint ) {
28
28
throw new Error ( "Multiple matrix-js-sdk entrypoints detected!" ) ;
29
29
}
30
- global . __js_sdk_entrypoint = true ;
30
+ globalThis . __js_sdk_entrypoint = true ;
31
31
32
32
// just *accessing* indexedDB throws an exception in firefox with indexeddb disabled.
33
33
let indexedDB : IDBFactory | undefined ;
34
34
try {
35
- indexedDB = global . indexedDB ;
35
+ indexedDB = globalThis . indexedDB ;
36
36
} catch ( e ) { }
37
37
38
38
// if our browser (appears to) support indexeddb, use an indexeddb crypto store.
@@ -44,4 +44,4 @@ if (indexedDB) {
44
44
// It's awkward, but required.
45
45
export * from "./matrix" ;
46
46
export default matrixcs ; // keep export for browserify package deps
47
- global . matrixcs = matrixcs ;
47
+ globalThis . matrixcs = matrixcs ;
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ limitations under the License.
16
16
17
17
import { logger } from "../logger" ;
18
18
19
- export let crypto = global . window ?. crypto ;
20
- export let subtleCrypto = global . window ?. crypto ?. subtle ?? global . window ?. crypto ?. webkitSubtle ;
21
- export let TextEncoder = global . window ?. TextEncoder ;
19
+ export let crypto = globalThis . window ?. crypto ;
20
+ export let subtleCrypto = globalThis . window ?. crypto ?. subtle ?? global . window ?. crypto ?. webkitSubtle ;
21
+ export let TextEncoder = globalThis . window ?. TextEncoder ;
22
22
23
23
/* eslint-disable @typescript-eslint/no-var-requires */
24
24
if ( ! crypto ) {
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export const verificationMethods = {
134
134
export type VerificationMethod = keyof typeof verificationMethods | string ;
135
135
136
136
export function isCryptoAvailable ( ) : boolean {
137
- return Boolean ( global . Olm ) ;
137
+ return Boolean ( globalThis . Olm ) ;
138
138
}
139
139
140
140
// minimum time between attempting to unwedge an Olm session, if we succeeded
You can’t perform that action at this time.
0 commit comments