From ff8e7c347173f05260c9b554bdbf3edac3414710 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Thu, 1 Jun 2023 23:21:42 -0400 Subject: [PATCH] update UpdateURL() to delete server session when connection failed --- source/ShowScenes.brs | 1 - source/utils/session.bs | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs index 91d95788..b6c4183d 100644 --- a/source/ShowScenes.brs +++ b/source/ShowScenes.brs @@ -8,7 +8,6 @@ function LoginFlow(startOver = false as boolean) startOver = not session.server.UpdateURL(serverUrl) if startOver print "Could not connect to previously saved server." - session.server.Delete() end if else startOver = true diff --git a/source/utils/session.bs b/source/utils/session.bs index 45a10fca..4f2e2552 100644 --- a/source/utils/session.bs +++ b/source/utils/session.bs @@ -64,7 +64,13 @@ namespace session ' validate parameters if value = "" then return false session.server.Update("url", value) - return session.server.Populate() + + success = session.server.Populate() + if not success + session.server.Delete() + end if + + return success end function ' Use the saved server url to populate the global server session array (m.global.session.server)