log error if there's more than 1 'other' category in analytics (#1109)
This commit is contained in:
parent
4ac9a6e005
commit
7e34f40a48
1 changed files with 16 additions and 0 deletions
|
|
@ -119,6 +119,22 @@ class ConstructListModel {
|
|||
// Add each item in this entry to the groupedByCategory map under the single category key
|
||||
groupedByCategory.putIfAbsent(category, () => []).addAll(entry.value);
|
||||
}
|
||||
final others = groupedByCategory.entries
|
||||
.where((entry) => entry.key.toLowerCase() == 'other')
|
||||
.toList();
|
||||
if (others.length > 1) {
|
||||
ErrorHandler.logError(
|
||||
e: "More than one 'other' category in groupedByCategory",
|
||||
data: {
|
||||
"others": others
|
||||
.map(
|
||||
(entry) =>
|
||||
("${entry.key}: ${entry.value.map((uses) => uses.id.string).toList()}"),
|
||||
)
|
||||
.toList(),
|
||||
},
|
||||
);
|
||||
}
|
||||
_categoriesToUses = groupedByCategory;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue