Fix empty invidious instance in preferences
This commit is contained in:
1 parent
13bb21c1f7
commit
1c8d075e87
3 files changed
+13
-2
No files matched your search
+11
-1
@@ -1,5 +1,7 @@
|
||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
@@ -7,6 +9,7 @@ function Init()
|
||||
m.top.itemSpacings = [8]
|
||||
|
||||
m.button = m.top.findNode("button")
|
||||
m.button.text = Invidious.DEFAULT_INSTANCE
|
||||
AdjustButtonLabel(m.button)
|
||||
|
||||
m.button.observeField("buttonSelected", FuncName(OpenInvidiousInstanceSettings))
|
||||
@@ -74,5 +77,12 @@ function OnValueChange() as void
|
||||
return
|
||||
end if
|
||||
|
||||
m.preferences[m.key] = m.top.value
|
||||
value = m.top.value
|
||||
m.preferences[m.key] = value
|
||||
|
||||
if StringUtils.IsNullOrEmpty(value)
|
||||
m.button.text = Invidious.DEFAULT_INSTANCE
|
||||
else
|
||||
m.button.text = value
|
||||
end if
|
||||
end function
|
||||
Reference in new issue
Block a user