From 2f534f9efaaf5cdbb85679a80e0f8956063d571d Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Mon, 11 Dec 2023 17:25:32 +0100 Subject: [PATCH] Fix peer expiration interval init on validation --- src/views/Settings.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/Settings.tsx b/src/views/Settings.tsx index 3fdee120..6b387781 100644 --- a/src/views/Settings.tsx +++ b/src/views/Settings.tsx @@ -481,12 +481,15 @@ export const Settings = () => { }; const createAccountToSave = (values: FormAccount): Account => { + let peer_login_expiration = values.peer_login_expiration_formatted? expiresInToSeconds( + values.peer_login_expiration_formatted + ) : accounts[0].settings.peer_login_expiration; + + let accountToSave = { id: formAccount.id, settings: { - peer_login_expiration: expiresInToSeconds( - values.peer_login_expiration_formatted - ), + peer_login_expiration: peer_login_expiration, peer_login_expiration_enabled: values.peer_login_expiration_enabled, jwt_groups_enabled: jwtGroupsEnabled, jwt_groups_claim_name: jwtGroupsClaimName,