From e6e5d5e9aa5e7d3b1ad11d754681da34583c07b8 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 23 Sep 2020 20:33:46 +0200 Subject: [PATCH] Report op error only if can run --- app/src/main/java/eu/faircode/email/Core.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 7119f1f611..1665d2d159 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -530,8 +530,10 @@ class Core { if (ops.size() == 0) state.batchCompleted(folder.id, priority, sequence); - else - state.error(new OperationCanceledException("Processing")); + else { + if (state.batchCanRun(folder.id, priority, sequence)) + state.error(new OperationCanceledException("Processing")); + } } finally { Log.i(folder.name + " end process state=" + state + " pending=" + ops.size()); }