Skip to content

Commit e3194d4

Browse files
committed
toggleAllowDownloadAndSync must not be extension thus user can create a new share
Signed-off-by: alperozturk <[email protected]>
1 parent 95fcbe0 commit e3194d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/src/main/java/com/owncloud/android/lib/resources/shares/extensions/OCShareExtensions.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ private const val PERMISSIONS_KEY = "permissions"
1818
private const val VALUE_KEY = "value"
1919
private const val ENABLED_KEY = "enabled"
2020

21-
fun OCShare?.toggleAllowDownloadAndSync(
21+
fun toggleAllowDownloadAndSync(
22+
attributes: String?,
2223
isChecked: Boolean,
2324
useV2DownloadAttributes: Boolean
2425
): String? {
2526
val jsonArray =
26-
if (this?.attributes?.isEmpty() == true) {
27+
if (attributes?.isEmpty() == true) {
2728
JSONArray()
2829
} else {
29-
JSONArray(this?.attributes)
30+
JSONArray(attributes)
3031
}
3132
val downloadAttr = jsonArray.findDownloadAttribute()
3233
val enabledKey = getEnabledKey(useV2DownloadAttributes)

0 commit comments

Comments
 (0)