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
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- A bug where the loading screen does not disappear if search results are empty.
|
- A bug where the loading screen does not disappear if search results are empty.
|
||||||
|
- Empty invidious instance in preferences when default instance is being used
|
||||||
|
|
||||||
## [0.20.2] - 2024-02-26
|
## [0.20.2] - 2024-02-26
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,7 @@
|
|||||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
@@ -7,6 +9,7 @@ function Init()
|
|||||||
m.top.itemSpacings = [8]
|
m.top.itemSpacings = [8]
|
||||||
|
|
||||||
m.button = m.top.findNode("button")
|
m.button = m.top.findNode("button")
|
||||||
|
m.button.text = Invidious.DEFAULT_INSTANCE
|
||||||
AdjustButtonLabel(m.button)
|
AdjustButtonLabel(m.button)
|
||||||
|
|
||||||
m.button.observeField("buttonSelected", FuncName(OpenInvidiousInstanceSettings))
|
m.button.observeField("buttonSelected", FuncName(OpenInvidiousInstanceSettings))
|
||||||
@@ -74,5 +77,12 @@ function OnValueChange() as void
|
|||||||
return
|
return
|
||||||
end if
|
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
|
end function
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<field id="displayText" type="string" alias="DisplayTextLabel.text" />
|
<field id="displayText" type="string" alias="DisplayTextLabel.text" />
|
||||||
<field id="description" type="string" alias="DescriptionLabel.text" />
|
<field id="description" type="string" alias="DescriptionLabel.text" />
|
||||||
<field id="value" type="string" alias="Button.text" onChange="OnValueChange" />
|
<field id="value" type="string" onChange="OnValueChange" />
|
||||||
<field id="appController" type="node" bind="/AppController" />
|
<field id="appController" type="node" bind="/AppController" />
|
||||||
<function name="BindPreference" />
|
<function name="BindPreference" />
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
Reference in new issue
Block a user