*Add more safety checks on window
This commit is contained in:
parent
648951208c
commit
200221e742
10
src/index.ts
10
src/index.ts
|
@ -15,12 +15,12 @@ const DHT_MODULE = "AQD1IgE4lTZkq1fqdoYGojKRNrSk0YQ_wrHbRtIiHDrnow";
|
|||
let callModule: typeof callModuleModule,
|
||||
connectModule: typeof connectModuleModule;
|
||||
|
||||
if (window.document) {
|
||||
callModule = callModuleKernel;
|
||||
connectModule = connectModuleKernel;
|
||||
if (typeof window !== "undefined" && window?.document) {
|
||||
callModule = callModuleKernel;
|
||||
connectModule = connectModuleKernel;
|
||||
} else {
|
||||
callModule = callModuleModule;
|
||||
connectModule = connectModuleModule;
|
||||
callModule = callModuleModule;
|
||||
connectModule = connectModuleModule;
|
||||
}
|
||||
|
||||
export class DHT {
|
||||
|
|
Loading…
Reference in New Issue