diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-02-23 16:42:52 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-02-23 16:42:52 -0600 |
commit | b4f2a6979afeeb6b0b29bbf668d61b23b65b47ec (patch) | |
tree | a73e44e25ff163b5668b64369fe1e3af11ac0b7f | |
parent | 4182edfd7e3333fcf31b94f2f091fe143945b809 (diff) | |
download | voidsky-b4f2a6979afeeb6b0b29bbf668d61b23b65b47ec.tar.zst |
Add setImmediate polyfill to web, fixing dropdown items
-rw-r--r-- | index.js | 1 | ||||
-rw-r--r-- | index.web.js | 1 | ||||
-rw-r--r-- | src/platform/polyfills.native.ts | 1 | ||||
-rw-r--r-- | src/platform/polyfills.ts | 1 | ||||
-rw-r--r-- | src/platform/polyfills.web.ts | 4 |
5 files changed, 6 insertions, 2 deletions
diff --git a/index.js b/index.js index 2d2c9ca44..1a6b21964 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ * @format */ +import 'platform/polyfills' import {AppRegistry} from 'react-native' import App from './src/App' import {name as appName} from './src/app.json' diff --git a/index.web.js b/index.web.js index 5154bfa7b..f443dbb6d 100644 --- a/index.web.js +++ b/index.web.js @@ -1,5 +1,6 @@ // index.web.js +import 'platform/polyfills' import {AppRegistry} from 'react-native' import App from './src/App' import {name as appName} from './src/app.json' diff --git a/src/platform/polyfills.native.ts b/src/platform/polyfills.native.ts deleted file mode 100644 index 26a535cca..000000000 --- a/src/platform/polyfills.native.ts +++ /dev/null @@ -1 +0,0 @@ -import '@zxing/text-encoding' // TextEncoder / TextDecoder diff --git a/src/platform/polyfills.ts b/src/platform/polyfills.ts index ac31e55ef..336ce12bb 100644 --- a/src/platform/polyfills.ts +++ b/src/platform/polyfills.ts @@ -1,2 +1 @@ -// do nothing export {} diff --git a/src/platform/polyfills.web.ts b/src/platform/polyfills.web.ts new file mode 100644 index 000000000..7a42f4887 --- /dev/null +++ b/src/platform/polyfills.web.ts @@ -0,0 +1,4 @@ +/// <reference lib="dom" /> + +// @ts-ignore whatever typescript wants to complain about here, I dont care about -prf +window.setImmediate = (cb: () => void) => setTimeout(cb, 0) |