File tree Expand file tree Collapse file tree
app/src/main/java/com/deniscerri/ytdl/ui/more/settings/updating Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments