mirror of
https://github.com/nextcloud/android-library.git
synced 2025-07-21 23:47:23 +00:00
toggleAllowDownloadAndSync must not be extension thus user can create a new share
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:

committed by
Alper Öztürk

parent
21beee4502
commit
bb94fbce23
@ -18,15 +18,16 @@ private const val PERMISSIONS_KEY = "permissions"
|
||||
private const val VALUE_KEY = "value"
|
||||
private const val ENABLED_KEY = "enabled"
|
||||
|
||||
fun OCShare?.toggleAllowDownloadAndSync(
|
||||
fun toggleAllowDownloadAndSync(
|
||||
attributes: String?,
|
||||
isChecked: Boolean,
|
||||
useV2DownloadAttributes: Boolean
|
||||
): String? {
|
||||
val jsonArray =
|
||||
if (this?.attributes?.isEmpty() == true) {
|
||||
if (attributes?.isEmpty() == true) {
|
||||
JSONArray()
|
||||
} else {
|
||||
JSONArray(this?.attributes)
|
||||
JSONArray(attributes)
|
||||
}
|
||||
val downloadAttr = jsonArray.findDownloadAttribute()
|
||||
val enabledKey = getEnabledKey(useV2DownloadAttributes)
|
||||
|
Reference in New Issue
Block a user