From d1935e209b42a9e5853efc44e2c1e27b03f1f273 Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Tue, 5 Jul 2022 10:40:29 +0200 Subject: [PATCH] Fix error on deleting device used for login (#729) This fixes a bug showing an error loading the list of devices after deleting the device that was used to authenticate the current session with. --- src/frontend/src/flows/manage/deviceSettings.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/src/flows/manage/deviceSettings.ts b/src/frontend/src/flows/manage/deviceSettings.ts index 2b2ac7936a..63ea5c749c 100644 --- a/src/frontend/src/flows/manage/deviceSettings.ts +++ b/src/frontend/src/flows/manage/deviceSettings.ts @@ -207,6 +207,14 @@ const init = async ( } await removalConnection.remove(userNumber, device.pubkey); }); + + if (sameDevice) { + // clear anchor and reload the page. + // do not resolve, otherwise the management page will try to reload the list of devices which will cause an error + localStorage.clear(); + location.reload(); + return; + } resolve(); }; }