Fix to last unhappy path.

This commit is contained in:
Jimi 2022-05-30 06:12:43 -06:00 committed by Cody Robibero
parent cfe1a4c118
commit 738efd8079
3 changed files with 23 additions and 8 deletions

View File

@ -33,11 +33,8 @@ sub OnAuthenticated()
m.top.close = true
m.top.authenticated = true
else
dialog = createObject("roSGNode", "Dialog")
dialog.title = tr("Quick Connect")
dialog.buttons = [tr("OK")]
dialog.message = tr("There was an error authenticating via Quick Connect.")
m.scene.dialog = dialog
m.top.close = true
m.top.authenticated = false
end if
end if
end sub

View File

@ -6,7 +6,7 @@
</children>
<interface>
<field id="quickConnectJson" type="assocarray" />
<field id="authenticated" type="boolean" />
<field id="authenticated" type="boolean" alwaysNotify="true"/>
</interface>
<script type="text/brightscript" uri="QuickConnectDialog.brs" />
<script type="text/brightscript" uri="pkg:/source/api/userauth.brs" />

View File

@ -243,8 +243,26 @@ function CreateSigninGroup(user = "")
m.scene.dialog = m.quickConnectDialog
end if
else if msg.getField() = "authenticated"
' Quick connect authentication was successful...
return "true"
authenticated = msg.getData()
if authenticated = true
' Quick connect authentication was successful...
return "true"
else
dialog = createObject("roSGNode", "Dialog")
dialog.id = "QuickConnectError"
dialog.title = tr("Quick Connect")
dialog.buttons = [tr("OK")]
dialog.message = tr("There was an error authenticating via Quick Connect.")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", port)
end if
else
' If there are no other button matches, check if this is a simple "OK" Dialog & Close if so
dialog = msg.getRoSGNode()
if dialog.id = "QuickConnectError"
dialog.unobserveField("buttonSelected")
dialog.close = true
end if
end if
end if
end while