aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-03 00:22:10 -0700
committerAllan Wang <me@allanwang.ca>2017-06-03 00:22:10 -0700
commit5796566137995c8d244720f87ba85bce0e0d2f00 (patch)
tree1736e12182c7cf2769ad953029dc6a645b803802 /app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
parentbc197ad5769ee792d930ac5b634e1e9000230689 (diff)
downloadfrost-5796566137995c8d244720f87ba85bce0e0d2f00.tar.gz
frost-5796566137995c8d244720f87ba85bce0e0d2f00.tar.bz2
frost-5796566137995c8d244720f87ba85bce0e0d2f00.zip
css updates and beginning login migration
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index e8c65be3..5d7d145f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
@@ -1,8 +1,10 @@
package com.pitchedapps.frost
-import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
+import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
+import com.pitchedapps.frost.utils.L
+import com.pitchedapps.frost.utils.Prefs
/**
* Created by Allan Wang on 2017-05-28.
@@ -11,7 +13,18 @@ class StartActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- startActivity(Intent(this, MainActivity::class.java))
- finish()
+
+ L.d("Load cookies ${System.currentTimeMillis()}")
+ loadFbCookiesAsync {
+ cookies ->
+ L.d("Cookies loaded ${System.currentTimeMillis()} $cookies")
+ val sorted = cookies.toMutableList()
+ val current = cookies.filter { it.id == Prefs.userId }
+ if (current.isNotEmpty()) {
+ sorted.remove(current[0])
+ sorted.add(0, current[0])
+ }
+ MainActivity.launch(this, sorted)
+ }
}
} \ No newline at end of file