You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-12 07:02:50 +03:00
Use text-encoding-utf-8 as a TextEncoder polyfill
Somebody else seems to have done a good job of polyfilling TextEncoder, so let's use that.
This commit is contained in:
@@ -17,13 +17,14 @@ limitations under the License.
|
||||
"use strict";
|
||||
|
||||
// polyfill textencoder if necessary
|
||||
import * as TextEncodingUtf8 from 'text-encoding-utf-8';
|
||||
let TextEncoder = window.TextEncoder;
|
||||
if (!TextEncoder) {
|
||||
TextEncoder = require('./TextEncoderPolyfill');
|
||||
TextEncoder = TextEncodingUtf8.TextEncoder;
|
||||
}
|
||||
let TextDecoder = window.TextDecoder;
|
||||
if (TextDecoder) {
|
||||
TextDecoder = require('./TextDecoderPolyfill');
|
||||
if (!TextDecoder) {
|
||||
TextDecoder = TextEncodingUtf8.TextDecoder;
|
||||
}
|
||||
|
||||
const subtleCrypto = window.crypto.subtle || window.crypto.webkitSubtle;
|
||||
|
Reference in New Issue
Block a user