Skip to content

Commit d8523f4

Browse files
committed
[settings] minor fixes
1 parent d44318a commit d8523f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/me/capcom/smsgateway/modules/messages/MessagesSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class MessagesSettings(
148148

149149
LIMIT_VALUE -> {
150150
val limitValue = value?.toString()?.toFloat()?.toInt()
151-
if (limitValue != null && limitValue < 1) {
152-
throw IllegalArgumentException("Limit value must be >= 1")
151+
if (limitValue != null && limitValue < 0) {
152+
throw IllegalArgumentException("Limit value must be >= 0")
153153
}
154154

155155
val changed = this.limitValue != (limitValue ?: 0)

app/src/main/java/me/capcom/smsgateway/modules/webhooks/WebhooksSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class WebhooksSettings(
4141
when (key) {
4242
INTERNET_REQUIRED -> {
4343
val newValue = value?.toString()?.toBoolean()
44-
val changed = this.internetRequired != newValue
44+
val changed = this.internetRequired != (newValue ?: true)
4545

4646
storage.set(key, newValue)
4747

@@ -54,7 +54,7 @@ class WebhooksSettings(
5454
throw IllegalArgumentException("Retry count must be >= 1")
5555
}
5656

57-
val changed = this.retryCount != retryCount
57+
val changed = this.retryCount != (retryCount ?: 15)
5858

5959
storage.set(key, retryCount?.toString())
6060

0 commit comments

Comments
 (0)