Skip to content

Commit

Permalink
Fix subs id check (#3714)
Browse files Browse the repository at this point in the history
* Fix subs id check

Fix subs id check

* Update MainViewModel.kt
  • Loading branch information
CodeWithTamim authored Oct 21, 2024
1 parent daa0394 commit fe8b825
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
var subscriptionId: String = MmkvManager.settingsStorage.decodeString(AppConfig.CACHE_SUBSCRIPTION_ID, "").orEmpty()

//var keywordFilter: String = MmkvManager.settingsStorage.decodeString(AppConfig.CACHE_KEYWORD_FILTER, "")?:""
var keywordFilter = ""
var keywordFilter = ""
val serversCache = mutableListOf<ServersCache>()
val isRunning by lazy { MutableLiveData<Boolean>() }
val updateListAction by lazy { MutableLiveData<Int>() }
Expand Down Expand Up @@ -153,7 +153,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
}

fun updateConfigViaSubAll(): Int {
if (subscriptionId.isNullOrEmpty()) {
if (subscriptionId.isEmpty()) {
return AngConfigManager.updateConfigViaSubAll()
} else {
val subItem = MmkvManager.decodeSubscription(subscriptionId) ?: return 0
Expand All @@ -163,7 +163,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {

fun exportAllServer(): Int {
val serverListCopy =
if (subscriptionId.isNullOrEmpty() && keywordFilter.isNullOrEmpty()) {
if (subscriptionId.isEmpty() && keywordFilter.isNullOrEmpty()) {
serverList
} else {
serversCache.map { it.guid }.toList()
Expand Down Expand Up @@ -281,7 +281,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
}

fun removeAllServer() {
if (subscriptionId.isNullOrEmpty() && keywordFilter.isNullOrEmpty()) {
if (subscriptionId.isEmpty() && keywordFilter.isNullOrEmpty()) {
MmkvManager.removeAllServer()
} else {
val serversCopy = serversCache.toList()
Expand All @@ -292,7 +292,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
}

fun removeInvalidServer() {
if (subscriptionId.isNullOrEmpty() && keywordFilter.isNullOrEmpty()) {
if (subscriptionId.isEmpty() && keywordFilter.isNullOrEmpty()) {
MmkvManager.removeInvalidServer("")
} else {
val serversCopy = serversCache.toList()
Expand Down Expand Up @@ -394,4 +394,4 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
}
}
}
}
}
1 change: 0 additions & 1 deletion V2rayNG/app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="TabLayoutTextStyle" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
</style>
Expand Down

0 comments on commit fe8b825

Please sign in to comment.