mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Resolve #1185
This commit is contained in:
parent
5cce4713a3
commit
2a45142644
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ fetchJSON = (action, sUrl, params, timeout, jsonCallback) => {
|
||||||
controller.timeoutId = timeout && setTimeout(() => abort(action, 'TimeoutError'), timeout);
|
controller.timeoutId = timeout && setTimeout(() => abort(action, 'TimeoutError'), timeout);
|
||||||
return rl.fetchJSON(sUrl, {signal: signal}, params).then(data => {
|
return rl.fetchJSON(sUrl, {signal: signal}, params).then(data => {
|
||||||
abort(action, 0, 1);
|
abort(action, 0, 1);
|
||||||
return jsonCallback(data);
|
return jsonCallback ? jsonCallback(data) : Promise.resolve(data);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
clearTimeout(controller.timeoutId);
|
clearTimeout(controller.timeoutId);
|
||||||
err.aborted = signal.aborted;
|
err.aborted = signal.aborted;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue