Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show loading spinner and disable remote during login #1470

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/Main.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 5 additions & 2 deletions source/ShowScenes.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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\ \-\_]", "")
Expand Down Expand Up @@ -140,6 +140,7 @@ function LoginFlow()
else
userSelected = ""
end if
stopLoadingSpinner()
passwordEntry = CreateSigninGroup(userSelected)
SendPerformanceBeacon("AppDialogComplete") ' Roku Performance monitoring - Dialog Closed
if passwordEntry = "backPressed"
Expand Down Expand Up @@ -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)
Expand All @@ -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"
Expand Down