Skip to content

Commit

Permalink
fix(CRA@4): import hack
Browse files Browse the repository at this point in the history
Closes peers#954
  • Loading branch information
jonasgloning committed May 13, 2022
1 parent e331bb4 commit 41c3ba7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/supports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import webRTCAdapter from "webrtc-adapter";
import webRTCAdapter_import from "webrtc-adapter";

const webRTCAdapter: typeof webRTCAdapter_import =
//@ts-ignore
webRTCAdapter_import.default || webRTCAdapter_import;

export const Supports = new (class {
readonly isIOS = ["iPad", "iPhone", "iPod"].includes(navigator.platform);
Expand Down Expand Up @@ -66,12 +70,12 @@ export const Supports = new (class {
}

toString(): string {
return `Supports:
browser:${this.getBrowser()}
version:${this.getVersion()}
isIOS:${this.isIOS}
isWebRTCSupported:${this.isWebRTCSupported()}
isBrowserSupported:${this.isBrowserSupported()}
return `Supports:
browser:${this.getBrowser()}
version:${this.getVersion()}
isIOS:${this.isIOS}
isWebRTCSupported:${this.isWebRTCSupported()}
isBrowserSupported:${this.isBrowserSupported()}
isUnifiedPlanSupported:${this.isUnifiedPlanSupported()}`;
}
})();

0 comments on commit 41c3ba7

Please sign in to comment.