refactor: move upload fetch timeout helper
This commit is contained in:
@@ -3879,6 +3879,10 @@ const SIDEBAR_TREE_JS: &str = r##"
|
||||
}
|
||||
|
||||
async function fetchWithTimeout(input, init, timeoutMs, label) {
|
||||
var runtimeFn = localUploadRuntimeFunction('fetchWithTimeout');
|
||||
if (runtimeFn) {
|
||||
return await runtimeFn(input, init || {}, timeoutMs, label);
|
||||
}
|
||||
var controller = typeof AbortController === 'function' ? new AbortController() : null;
|
||||
var timer = 0;
|
||||
try {
|
||||
@@ -10930,6 +10934,7 @@ mod tests {
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("function resolveEditorUploadContext"));
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("function editorRootFromUploadOptions"));
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("function openEditorUploadFilePicker"));
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("function fetchWithTimeout"));
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("uploadFilesWithResolvedTarget"));
|
||||
assert!(LOCAL_UPLOAD_RUNTIME_JS.contains("__mnoteLastEditorUploadRoot"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user