diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-11 17:52:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 17:52:24 -0500 |
commit | db262e95779e0a17275bdb94be2b0ac12819178e (patch) | |
tree | 42b89edf8796e85e362ca86dead1170cb38f6434 /app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt | |
parent | 1d4380cee77fc049a54d280a27dcefa3fa6ff1fd (diff) | |
download | frost-db262e95779e0a17275bdb94be2b0ac12819178e.tar.gz frost-db262e95779e0a17275bdb94be2b0ac12819178e.tar.bz2 frost-db262e95779e0a17275bdb94be2b0ac12819178e.zip |
Feature/tab customization (#522)
* Add initial tab customizing view
* Add rest of content for now
* Delete project file backups
* Stash
* Support full tab customization
* Test activity animations
* Update kau and fix sound uri
* Try catch download, resolves #523
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt index ff46856c..762dd4c1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt @@ -52,10 +52,10 @@ fun loadFbCookiesAsync(callback: (cookies: List<CookieModel>) -> Unit) { fun loadFbCookiesSync(): List<CookieModel> = (select from CookieModel::class).orderBy(CookieModel_Table.name, true).queryList() -fun saveFbCookie(cookie: CookieModel, callback: (() -> Unit)? = null) { +inline fun saveFbCookie(cookie: CookieModel, crossinline callback: (() -> Unit) = {}) { cookie.async save { L.d("Fb cookie saved", cookie.toString()) - callback?.invoke() + callback() } } @@ -65,7 +65,7 @@ fun removeCookie(id: Long) { } } -fun CookieModel.fetchUsername(callback: (String) -> Unit) { +inline fun CookieModel.fetchUsername(crossinline callback: (String) -> Unit) { ReactiveNetwork.checkInternetConnectivity().subscribeOn(Schedulers.io()).subscribe { yes, _ -> if (!yes) return@subscribe callback("") var result = "" |