Skip to content

Commit

Permalink
Fixed some loading issues with react-native.
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Jul 16, 2021
1 parent fa079d2 commit 6349ade
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class BrowserGlobalHandlerPlugin implements IEventPlugin {
private _client: ExceptionlessClient | null = null;

public startup(context: PluginContext): Promise<void> {
if (this._client) {
if (this._client || typeof window !== "object") {
return Promise.resolve();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/plugins/BrowserLifeCyclePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class BrowserLifeCyclePlugin implements IEventPlugin {
private _client: ExceptionlessClient | null = null;

public startup(context: PluginContext): Promise<void> {
if (this._client) {
if (this._client || typeof document !== "object") {
return Promise.resolve();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/plugins/BrowserModuleInfoPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class BrowserModuleInfoPlugin implements IEventPlugin {
}

private getModules(): ModuleInfo[] | undefined {
if (!document || !document.getElementsByTagName) {
if (typeof document !== "object" || !document.getElementsByTagName) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/plugins/BrowserRequestInfoPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class BrowserRequestInfoPlugin implements IEventPlugin {
}

private getRequestInfo(context: EventPluginContext): RequestInfo | undefined {
if (!document || !navigator || !location) {
if (typeof document !== "object" || typeof navigator !== "object" || typeof location !== "object") {
return;
}

Expand Down
1 change: 0 additions & 1 deletion packages/browser/src/plugins/BrowserWrapFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class BrowserWrapFunctions implements IEventPlugin {
this._client = context.client;

// TODO: TraceKit.extendToAsynchronousCallbacks();

return Promise.resolve();
}
}

0 comments on commit 6349ade

Please sign in to comment.