mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-26 09:03:48 +08:00
Fix Fetch controller.abort(reason) handling #1220
This commit is contained in:
parent
a3bb108b33
commit
4c5f19579c
2 changed files with 3 additions and 4 deletions
|
@ -36,7 +36,7 @@ abort = (sAction, sReason, bClearOnly) => {
|
|||
oRequests[sAction] = null;
|
||||
if (controller) {
|
||||
clearTimeout(controller.timeoutId);
|
||||
bClearOnly || controller.abort(sReason || 'AbortError');
|
||||
bClearOnly || controller.abort(new DOMException(sAction, sReason || 'AbortError'));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -61,7 +61,6 @@ fetchJSON = (action, sUrl, params, timeout, jsonCallback) => {
|
|||
}).catch(err => {
|
||||
clearTimeout(controller.timeoutId);
|
||||
err.aborted = signal.aborted;
|
||||
err.reason = signal.reason;
|
||||
return Promise.reject(err);
|
||||
});
|
||||
};
|
||||
|
@ -165,7 +164,7 @@ export class AbstractFetchRemote
|
|||
.catch(err => {
|
||||
console.error({fetchError:err});
|
||||
fCallback && fCallback(
|
||||
'TimeoutError' == err.reason ? 3 : (err.name == 'AbortError' ? 2 : 1),
|
||||
'TimeoutError' == err.name ? 3 : (err.name == 'AbortError' ? 2 : 1),
|
||||
err
|
||||
);
|
||||
});
|
||||
|
|
|
@ -222,7 +222,7 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
|
|||
fCallback = (iError, oData, bCached) => {
|
||||
let error = '';
|
||||
if (iError) {
|
||||
if ('reload' != oData?.reason) {
|
||||
if ('reload' != oData?.name) {
|
||||
error = getNotification(iError);
|
||||
MessagelistUserStore.loading(false);
|
||||
// if (Notifications.RequestAborted !== iError) {
|
||||
|
|
Loading…
Reference in a new issue