Allow removing operations with errors only

pull/147/head
M66B 6 years ago
parent 186f5f2580
commit e1b52d113d

@ -25,6 +25,7 @@ import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -140,11 +141,13 @@ public class FragmentOperations extends FragmentEx {
@Override @Override
protected Void onLoad(Context context, Bundle args) { protected Void onLoad(Context context, Bundle args) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
EntityOperation operation = db.operation().getOperationFirst(); List<EntityOperation> ops = db.operation().getOperationsError();
if (operation != null) { Log.i(Helper.TAG, "Operations with error count=" + ops.size());
if (operation.message != null) for (EntityOperation op : ops) {
db.message().setMessageUiHide(operation.message, false); Log.w(Helper.TAG, "Deleting operation=" + op.id + " error=" + op.error);
db.operation().deleteOperation(operation.id); if (op.message != null)
db.message().setMessageUiHide(op.message, false);
db.operation().deleteOperation(op.id);
} }
return null; return null;
} }

Loading…
Cancel
Save