From b45d0514b1e81dc6682b76f4af0744d41e72fcfc Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Tue, 27 Feb 2024 19:47:53 +0100 Subject: [PATCH] Always request update on error or state change. --- src/components/mfaDevices/mfaDevices.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/mfaDevices/mfaDevices.js b/src/components/mfaDevices/mfaDevices.js index ead2788..a0c14a1 100644 --- a/src/components/mfaDevices/mfaDevices.js +++ b/src/components/mfaDevices/mfaDevices.js @@ -82,17 +82,20 @@ export default class MfaDevices extends LitElement { logger.log('Failed to register new device because it is not supported', error); this.state = states.NEW; this.error = 'This device no longer supports security devices.'; + this.requestUpdate(); return; } // The operation was cancelled, just ignore the error; if (error.message && error.message.match('The operation either timed out or was not allowed')) { this.state = states.NEW; + this.error = null; + this.requestUpdate(); return; } logger.error('Failed to register new device', error); - this.error = error.message || error.data && (error.data.title || error.data.errorCode); this.state = states.NEW; + this.error = error.message || error.data && (error.data.title || error.data.errorCode); } this.requestUpdate();