mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
fix(core): fix throw if aborted polyfill (#10321)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
|
// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
|
||||||
export function throwIfAborted(abort?: AbortSignal) {
|
export function throwIfAborted(abort?: AbortSignal) {
|
||||||
if (abort?.aborted) {
|
if (abort?.aborted) {
|
||||||
throw new Error(abort.reason);
|
throw abort.reason;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
|
// because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill
|
||||||
export function throwIfAborted(abort?: AbortSignal) {
|
export function throwIfAborted(abort?: AbortSignal) {
|
||||||
if (abort?.aborted) {
|
if (abort?.aborted) {
|
||||||
throw new Error(abort.reason);
|
throw abort.reason;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user