Skip to content

Commit 11dac2c

Browse files
committed
hide app update settings for foss
1 parent 13e9bee commit 11dac2c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

app/src/main/java/com/deniscerri/ytdl/ui/more/settings/updating/UpdateSettingsModule.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ object UpdateSettingsModule : SettingModule {
3131
val updateUtil = UpdateUtil(context)
3232
val ytdlpViewModel = ViewModelProvider(host.hostViewModelStoreOwner)[YTDLPViewModel::class.java]
3333
val settingsViewModel = ViewModelProvider(host.hostViewModelStoreOwner)[SettingsViewModel::class.java]
34+
35+
val canUpdateApp = BuildConfig.FLAVOR == "github";
36+
3437
when(pref.key) {
3538
"ytdlp_source_label" -> {
3639
pref.apply {
@@ -92,7 +95,7 @@ object UpdateSettingsModule : SettingModule {
9295
val nativeLibraryDir = context.applicationInfo?.nativeLibraryDir
9396
summary = "${BuildConfig.VERSION_NAME} (${nativeLibraryDir?.split("/lib/")?.get(1)})"
9497

95-
if (BuildConfig.FLAVOR == "github") {
98+
if (canUpdateApp) {
9699
onPreferenceClickListener =
97100
Preference.OnPreferenceClickListener {
98101
host.hostLifecycleOwner.lifecycleScope.launch{
@@ -116,6 +119,16 @@ object UpdateSettingsModule : SettingModule {
116119
}
117120
}
118121
}
122+
"update_app" -> {
123+
pref.apply {
124+
isVisible = canUpdateApp
125+
}
126+
}
127+
"update_beta" -> {
128+
pref.apply {
129+
isVisible = canUpdateApp
130+
}
131+
}
119132
}
120133
}
121134

0 commit comments

Comments
 (0)