From 41c3ba7b2ca6adc226efd0e2add546a570a4aa3a Mon Sep 17 00:00:00 2001 From: Jonas Gloning <34194370+jonasgloning@users.noreply.github.com> Date: Fri, 13 May 2022 20:56:45 +0200 Subject: [PATCH] fix(CRA@4): import hack Closes #954 --- lib/supports.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/supports.ts b/lib/supports.ts index a4558e148..902b61aed 100644 --- a/lib/supports.ts +++ b/lib/supports.ts @@ -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); @@ -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()}`; } })();