chart improvements, synch working
This commit is contained in:
@@ -790,15 +790,24 @@ class TxMetaController extends ChangeNotifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// OR filter: any selected label, and/or unlabeled when uncategorized is selected.
|
||||
/// AND filter: every selected label must be on the tx.
|
||||
///
|
||||
/// Uncategorized alone matches unlabeled txs. Uncategorized combined with
|
||||
/// other labels matches nothing (a tx cannot be both).
|
||||
bool _matchesLabelFilter(TxMeta meta, Set<String> labelIds) {
|
||||
final wantUncategorized = labelIds.contains(kUncategorizedFilterId);
|
||||
if (wantUncategorized && !meta.hasLabel) return true;
|
||||
for (final id in labelIds) {
|
||||
if (id == kUncategorizedFilterId) continue;
|
||||
if (meta.labelIds.contains(id)) return true;
|
||||
final required = <String>[
|
||||
for (final id in labelIds)
|
||||
if (id != kUncategorizedFilterId) id,
|
||||
];
|
||||
if (wantUncategorized) {
|
||||
if (required.isNotEmpty) return false;
|
||||
return !meta.hasLabel;
|
||||
}
|
||||
return false;
|
||||
for (final id in required) {
|
||||
if (!meta.labelIds.contains(id)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Labels currently used by [transactions].
|
||||
|
||||
Reference in New Issue
Block a user