|
@@ -18,6 +18,13 @@ class ToggleSource(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ fun await(sourceIds: List<Long>, enable: Boolean) {
|
|
|
+ val transformedSourceIds = sourceIds.map { it.toString() }
|
|
|
+ preferences.disabledSources().getAndSet { disabled ->
|
|
|
+ if (enable) disabled.minus(transformedSourceIds) else disabled.plus(transformedSourceIds)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private fun isEnabled(sourceId: Long): Boolean {
|
|
|
return sourceId.toString() in preferences.disabledSources().get()
|
|
|
}
|