From eb1c4290bddf1216381ef08f9ce7f660bb8d06da Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Sat, 4 Nov 2023 21:48:39 -0400 Subject: [PATCH] show loading spinner and disable remote on login --- source/Main.brs | 2 ++ source/ShowScenes.brs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/Main.brs b/source/Main.brs index f2d0ecf05..d2db1fc6b 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -36,6 +36,8 @@ sub Main (args as dynamic) as void ' remove previous scenes from the stack sceneManager.callFunc("clearScenes") + stopLoadingSpinner() + ' load home page sceneManager.currentUser = m.global.session.user.name group = CreateHomeGroup() diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs index 9c0f1297d..79c41a197 100644 --- a/source/ShowScenes.brs +++ b/source/ShowScenes.brs @@ -86,13 +86,13 @@ function LoginFlow() end if ' push all users to the user select view userSelected = CreateUserSelectGroup(publicUsersNodes) - SendPerformanceBeacon("AppDialogComplete") ' Roku Performance monitoring - Dialog Closed if userSelected = "backPressed" session.server.Delete() unset_setting("server") goto start_login - else + else if userSelected <> "" + startMediaLoadingSpinner() print "A public user was selected with username=" + userSelected session.user.Update("name", userSelected) regex = CreateObject("roRegex", "[^a-zA-Z0-9\ \-\_]", "") @@ -140,6 +140,7 @@ function LoginFlow() else userSelected = "" end if + stopLoadingSpinner() passwordEntry = CreateSigninGroup(userSelected) SendPerformanceBeacon("AppDialogComplete") ' Roku Performance monitoring - Dialog Closed if passwordEntry = "backPressed" @@ -480,6 +481,7 @@ function CreateSigninGroup(user = "") else if type(msg) = "roSGNodeEvent" node = msg.getNode() if node = "submit" + startMediaLoadingSpinner() ' Validate credentials activeUser = get_token(username.value, password.value) if isValid(activeUser) @@ -494,6 +496,7 @@ function CreateSigninGroup(user = "") end if return "true" end if + stopLoadingSpinner() print "Login attempt failed..." group.findNode("alert").text = tr("Login attempt failed.") else if node = "quickConnect"