aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-03-07 04:00:20 -0500
committerAllan Wang <me@allanwang.ca>2019-03-07 04:00:20 -0500
commitf1878133d8af686ce8c27acffe28f26e9dda5165 (patch)
tree5d0d31d0581cb23495eea84437bdf74272081e20 /app/src/main
parenteabc8e3393cbd6b3dba5c70a5920075b8158d84e (diff)
downloadfrost-f1878133d8af686ce8c27acffe28f26e9dda5165.tar.gz
frost-f1878133d8af686ce8c27acffe28f26e9dda5165.tar.bz2
frost-f1878133d8af686ce8c27acffe28f26e9dda5165.zip
Add koin test
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/db/CacheDb.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt5
3 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/CacheDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/CacheDb.kt
index bd6bff4b..4d6bc938 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/db/CacheDb.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/db/CacheDb.kt
@@ -53,4 +53,5 @@ interface CacheDao {
suspend fun deleteById(id: Long)
}
-suspend fun CacheDao.save(id: String, contents: String) = insertCache(CacheEntity(id, System.currentTimeMillis(), contents)) \ No newline at end of file
+suspend fun CacheDao.save(id: String, contents: String) =
+ insertCache(CacheEntity(id, System.currentTimeMillis(), contents)) \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt
index b83fce52..29296494 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt
@@ -71,6 +71,8 @@ class FrostDatabase(private val privateDb: FrostPrivateDatabase, private val pub
single { create(context) }
single { get<FrostDatabase>().cookieDao() }
single { get<FrostDatabase>().tabDao() }
+ single { get<FrostDatabase>().cacheDao() }
+ single { get<FrostDatabase>().notifDao() }
}
/**
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt
index c2bb0837..f4e74509 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt
@@ -24,14 +24,9 @@ import androidx.room.Query
import androidx.room.Transaction
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.facebook.defaultTabs
-import com.pitchedapps.frost.utils.L
import com.raizlabs.android.dbflow.annotation.Database
import com.raizlabs.android.dbflow.annotation.PrimaryKey
import com.raizlabs.android.dbflow.annotation.Table
-import com.raizlabs.android.dbflow.kotlinextensions.database
-import com.raizlabs.android.dbflow.kotlinextensions.fastSave
-import com.raizlabs.android.dbflow.kotlinextensions.from
-import com.raizlabs.android.dbflow.kotlinextensions.select
import com.raizlabs.android.dbflow.structure.BaseModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext