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;
|
||||
}
|
||||
|
||||
if (err instanceof AbnormalPortalConfigError) {
|
||||
if (!(err instanceof AbnormalPortalConfigError)) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
logger.info(
|
||||
`Got abnormal portal config: ${err.message}, retrying...`
|
||||
);
|
||||
set(statusAtom, "prelogin");
|
||||
prelogin = await portalService.prelogin(portal);
|
||||
continue;
|
||||
} else {
|
||||
throw err;
|
||||
const isProcessing = get(isProcessingAtom);
|
||||
if (!isProcessing) {
|
||||
logger.info("Operation cancelled");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user