Skip to content

Commit

Permalink
set email properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Julesssss committed Mar 5, 2018
1 parent ba15442 commit 80ff1ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
})
Expand Down Expand Up @@ -90,6 +92,7 @@ class WelcomeActivity : GoogleSignInActivity() {
.setCategory("Action")
.setAction("Welcome--Logged In")
.build())
setIsLoading(false)
Preferences.setShouldShowWelcomeScreen(applicationContext, false)
finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 80ff1ce

Please sign in to comment.