Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/main/java/to/bitkit/async/ServiceQueue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum class ServiceQueue {

private val scope by lazy { CoroutineScope(newSingleThreadDispatcher(name) + SupervisorJob()) }

val queueContext: CoroutineContext get() = scope.coroutineContext

fun <T> blocking(
coroutineContext: CoroutineContext = scope.coroutineContext,
block: suspend CoroutineScope.() -> T,
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/to/bitkit/data/CacheStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ private val Context.appCacheDataStore: DataStore<AppCacheData> by dataStore(

@Suppress("TooManyFunctions")
@Singleton
class CacheStore @Inject constructor(
@ApplicationContext private val context: Context,
class CacheStore internal constructor(
private val store: DataStore<AppCacheData>,
) {
private val store = context.appCacheDataStore
@Inject
constructor(@ApplicationContext context: Context) : this(context.appCacheDataStore)

val data: Flow<AppCacheData> = store.data
val backupStatuses: Flow<Map<BackupCategory, BackupItemStatus>> = data.map { it.backupStatuses }
Expand Down
Loading
Loading