Label fix (#411)

* Cleanup label printing options

- Improve calls to setState()
- Should fix potential race conditions

* Use name if description not available

* Code simplification

* Fetch plugins even if the server reports "plugins enabled"

- Builtin plugins are still a thing!

* Use name *and* description to display label
This commit is contained in:
Oliver 2023-08-12 20:41:11 +10:00 committed by GitHub
parent d81f0d532d
commit 8200140976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 30 deletions

View file

@ -66,12 +66,18 @@ Future<void> selectAndPrintLabel(
// Construct list of available label templates
for (var label in labels) {
String display_name = (label["description"] ?? "").toString();
String name = (label["name"] ?? "").toString();
String description = (label["description"] ?? "").toString();
if (description.isNotEmpty) {
name += " - ${description}";
}
int pk = (label["pk"] ?? -1) as int;
if (display_name.isNotEmpty && pk > 0) {
if (name.isNotEmpty && pk > 0) {
label_options.add({
"display_name": display_name,
"display_name": name,
"value": pk,
});
}