Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-native): error Cannot create URL for blob #1840

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/BufferedDuplex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Duplex, Transform } from 'readable-stream'
import { Buffer } from 'buffer';

Check failure on line 2 in src/lib/BufferedDuplex.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Delete `;`
import { IClientOptions } from './client'

/**
Expand Down
8 changes: 7 additions & 1 deletion src/lib/get-timer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isBrowser, { isWebWorker } from './is-browser'
import isBrowser, { isWebWorker, isReactNativeBrowser } from './is-browser'
import { clearTimeout as clearT, setTimeout as setT } from 'worker-timers'
import type { TimerVariant } from './shared'

Expand Down Expand Up @@ -30,7 +30,13 @@
}
case 'auto':
default: {

Check failure on line 33 in src/lib/get-timer.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Delete `⏎`
if (isBrowser && isReactNativeBrowser) {
return nativeTimer
}

return isBrowser && !isWebWorker ? workerTimer : nativeTimer

Check failure on line 38 in src/lib/get-timer.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Delete `⏎`

MaximoLiberata marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/is-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ const isBrowser =

export const isWebWorker = isWebWorkerEnv()

export const isReactNativeBrowser = isReactNativeEnv()

export default isBrowser
2 changes: 1 addition & 1 deletion src/lib/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
}
}
}
export const nextTick = process
export const nextTick = typeof process?.nextTick === 'function'

Check failure on line 79 in src/lib/shared.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `·` with `⏎↹`
? process.nextTick

Check failure on line 80 in src/lib/shared.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Insert `↹`
: (callback: () => void) => {

Check failure on line 81 in src/lib/shared.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Insert `↹`
setTimeout(callback, 0)

Check failure on line 82 in src/lib/shared.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Insert `↹`
}

Check failure on line 83 in src/lib/shared.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Insert `↹`
Loading