Prevent deleting folders with pending operations

This commit is contained in:
M66B 2018-12-06 17:28:51 +01:00
parent 498c9d351e
commit 0b8475223c
1 changed files with 5 additions and 0 deletions

View File

@ -272,6 +272,11 @@ public class FragmentFolder extends FragmentEx {
long id = args.getLong("id");
DB db = DB.getInstance(getContext());
int count = db.operation().getOperationCount(id, null);
if (count > 0)
throw new IllegalArgumentException(
getResources().getQuantityString(
R.plurals.title_notification_operations, count, count));
db.folder().setFolderTbd(id);
ServiceSynchronize.reload(getContext(), "delete folder");