mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
refactor: support cancel during retry
This commit is contained in:
parent
69502b22a9
commit
c4fa91f6ea
@ -64,14 +64,19 @@ export const connectPortalAtom = atom(
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err instanceof AbnormalPortalConfigError) {
|
if (!(err instanceof AbnormalPortalConfigError)) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`Got abnormal portal config: ${err.message}, retrying...`
|
`Got abnormal portal config: ${err.message}, retrying...`
|
||||||
);
|
);
|
||||||
|
set(statusAtom, "prelogin");
|
||||||
prelogin = await portalService.prelogin(portal);
|
prelogin = await portalService.prelogin(portal);
|
||||||
continue;
|
const isProcessing = get(isProcessingAtom);
|
||||||
} else {
|
if (!isProcessing) {
|
||||||
throw err;
|
logger.info("Operation cancelled");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user