Merge pull request #588 from Dimitrije-Ciric/master

This commit is contained in:
Neil Burrows 2022-05-11 07:40:43 +01:00 committed by GitHub
commit f11f7661ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -41,8 +41,11 @@ function PlaystateDefaults(params = {} as object)
'"PlaySessionId": "",
'"RepeatMode": "RepeatNone"
}
for each p in params.items()
new_params[p.key] = p.value
paramsArray = params.items()
for i = 0 to paramsArray.count() - 1
item = paramsArray[i]
new_params[item.key] = item.value
end for
return FormatJson(new_params)
end function

View File

@ -38,11 +38,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
else if key = "down" and m.serverUrlContainer.hasFocus()
m.submit.setFocus(true)
else if key = "options"
serverName = m.serverPicker.content.getChild(m.serverPicker.itemFocused).name
if m.servers.Count() > 0 and Instr(1, serverName, "Saved") > 0
'Can only delete previously saved servers, not locally discovered ones
'So if we are on a "Saved" item, let the options dialog be shown (handled elsewhere)
handled = false
if m.serverPicker.itemFocused >= 0 and m.serverPicker.itemFocused < m.serverPicker.content.getChildCount()
serverName = m.serverPicker.content.getChild(m.serverPicker.itemFocused).name
if m.servers.Count() > 0 and Instr(1, serverName, "Saved") > 0
'Can only delete previously saved servers, not locally discovered ones
'So if we are on a "Saved" item, let the options dialog be shown (handled elsewhere)
handled = false
end if
end if
else
handled = false