Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk
2025-07-01 10:03:41 +02:00
committed by Alper Öztürk
parent bb94fbce23
commit 0303be50f9

View File

@ -23,12 +23,11 @@ fun toggleAllowDownloadAndSync(
isChecked: Boolean,
useV2DownloadAttributes: Boolean
): String? {
val jsonArray =
if (attributes?.isEmpty() == true) {
JSONArray()
} else {
JSONArray(attributes)
}
var jsonArray = JSONArray()
if (!attributes.isNullOrEmpty()) {
jsonArray = JSONArray(attributes)
}
val downloadAttr = jsonArray.findDownloadAttribute()
val enabledKey = getEnabledKey(useV2DownloadAttributes)