diff --git a/app/src/main/java/website/julianrosser/birthdays/activities/BirthdayListActivity.java b/app/src/main/java/website/julianrosser/birthdays/activities/BirthdayListActivity.java index 906ebc7..a2f07d3 100644 --- a/app/src/main/java/website/julianrosser/birthdays/activities/BirthdayListActivity.java +++ b/app/src/main/java/website/julianrosser/birthdays/activities/BirthdayListActivity.java @@ -16,6 +16,7 @@ import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; +import android.util.Log; import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; @@ -565,7 +566,7 @@ private void migratejsonBirthdays(final FirebaseUser firebaseUser) { } @Override public void onFailure(String message) { - Snackbar.make(floatingActionButton, "Error migrating: $message", Snackbar.LENGTH_LONG).show(); + Log.i("Migration", "Error migrating: $message"); } }); } diff --git a/app/src/main/java/website/julianrosser/birthdays/activities/WelcomeActivity.kt b/app/src/main/java/website/julianrosser/birthdays/activities/WelcomeActivity.kt index 0b8cdb4..e2ece9c 100644 --- a/app/src/main/java/website/julianrosser/birthdays/activities/WelcomeActivity.kt +++ b/app/src/main/java/website/julianrosser/birthdays/activities/WelcomeActivity.kt @@ -55,10 +55,12 @@ class WelcomeActivity : GoogleSignInActivity() { } override fun onGoogleFailure(message: String) { + setIsLoading(false) Log.i(javaClass.simpleName, "onGoogleFailure: $message") } override fun onFirebaseFailure(message: String) { + setIsLoading(false) Log.i(javaClass.simpleName, "New or signed out user: $message") } }) @@ -90,6 +92,7 @@ class WelcomeActivity : GoogleSignInActivity() { .setCategory("Action") .setAction("Welcome--Logged In") .build()) + setIsLoading(false) Preferences.setShouldShowWelcomeScreen(applicationContext, false) finish() } diff --git a/app/src/main/java/website/julianrosser/birthdays/database/DatabaseHelper.java b/app/src/main/java/website/julianrosser/birthdays/database/DatabaseHelper.java index 59699f9..a1ead0e 100644 --- a/app/src/main/java/website/julianrosser/birthdays/database/DatabaseHelper.java +++ b/app/src/main/java/website/julianrosser/birthdays/database/DatabaseHelper.java @@ -174,7 +174,10 @@ public void migrateJsonToFirebase(Context context, FirebaseUser user, MigrateUse databaseReference.setValue(firebaseBirthday); } - setLastUpdatedTime(); + databaseReference = BirthdayReminder.getInstance().getDatabaseReference().child(user.getUid()); + databaseReference.child("lastUpdated").setValue(ServerValue.TIMESTAMP); + databaseReference.child("email").setValue(user.getEmail()); // todo refactor + Preferences.setHasMigratedjsonData(context, true); callback.onSuccess(jsonbirthdays.size());