mirror of
https://github.com/burrow-dev/burrow-client.git
synced 2026-11-18 17:37:50 -05:00
fix(app): handle captcha URL load failures
Add error handling to the captcha URL loading process to prevent unhandled promise rejections. If the URL fails to load, the captcha answer is cleared and the window is closed if it hasn't been destroyed.
This commit is contained in:
1 parent
ab8bfd5a9d
commit
3cb8764603
1 file changed
+6
-1
+6
-1
@@ -353,7 +353,12 @@ ipcMain.handle("captcha", (event, serverUrl, action) => new Promise(resolve => {
|
||||
captchaServer = null;
|
||||
answer("");
|
||||
});
|
||||
box.loadURL(new URL(`/captcha?action=${action === "signup" ? "signup" : "login"}`, server).href);
|
||||
box.loadURL(new URL(`/captcha?action=${action === "signup" ? "signup" : "login"}`, server).href).catch(() => {
|
||||
answer("");
|
||||
if (!box.isDestroyed()) {
|
||||
box.close();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
// what the client's processes use: the game is the "Pepper Plugin" one.
|
||||
|
||||
Reference in new issue
Block a user