Skip import of existing accounts

pull/201/head
M66B 3 years ago
parent 9fbb996e69
commit e6428cb530

@ -879,6 +879,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
JSONObject jaccount = (JSONObject) jaccounts.get(a);
EntityAccount account = EntityAccount.fromJSON(jaccount);
EntityAccount existing = db.account().getAccountByUUID(account.uuid);
if (existing != null)
continue;
if (account.auth_type == AUTH_TYPE_GMAIL) {
if (GmailState.getAccount(context, account.user) == null) {
Log.i("Google account not found user=" + account.user);

@ -90,6 +90,9 @@ public interface DaoAccount {
@Query("SELECT * FROM account WHERE id = :id")
EntityAccount getAccount(long id);
@Query("SELECT * FROM account WHERE uuid = :uuid")
EntityAccount getAccountByUUID(String uuid);
@Query("SELECT * FROM account WHERE name = :name")
EntityAccount getAccount(String name);

Loading…
Cancel
Save