Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
move companion object to the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Aug 3, 2023
1 parent a3f9705 commit e51c3fd
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ import kotlinx.coroutines.flow.distinctUntilChanged
class PatchBundlePersistenceRepository(db: AppDatabase) {
private val dao = db.patchBundleDao()

private companion object {
val defaultSource = PatchBundleEntity(
uid = 0,
name = "Main",
versionInfo = VersionInfo(),
source = Source.API,
autoUpdate = false
)
}

suspend fun loadConfiguration(): List<PatchBundleEntity> {
val all = dao.all()
if (all.isEmpty()) {
Expand Down Expand Up @@ -53,4 +43,14 @@ class PatchBundlePersistenceRepository(db: AppDatabase) {
suspend fun setAutoUpdate(uid: Int, value: Boolean) = dao.setAutoUpdate(uid, value)

fun getProps(id: Int) = dao.getPropsById(id).distinctUntilChanged()

private companion object {
val defaultSource = PatchBundleEntity(
uid = 0,
name = "Main",
versionInfo = VersionInfo(),
source = Source.API,
autoUpdate = false
)
}
}

0 comments on commit e51c3fd

Please sign in to comment.