Reload on delete only if synchronizing

pull/146/head
M66B 6 years ago
parent c8a76bf1be
commit 9a7802d319

@ -840,7 +840,10 @@ public class FragmentAccount extends FragmentEx {
@Override
protected Void onLoad(Context context, Bundle args) {
long id = args.getLong("id");
DB.getInstance(context).account().deleteAccount(id);
DB db = DB.getInstance(context);
EntityAccount account = db.account().getAccount(id);
db.account().deleteAccount(id);
if (account.synchronize)
ServiceSynchronize.reload(getContext(), "delete account");
return null;
}

@ -521,7 +521,10 @@ public class FragmentIdentity extends FragmentEx {
@Override
protected Void onLoad(Context context, Bundle args) {
long id = args.getLong("id");
DB.getInstance(context).identity().deleteIdentity(id);
DB db = DB.getInstance(context);
EntityIdentity identity = db.identity().getIdentity(id);
db.identity().deleteIdentity(id);
if (identity.synchronize)
ServiceSynchronize.reload(getContext(), "delete identity");
return null;
}

Loading…
Cancel
Save