fix: Do not display empty file description body
This commit is contained in:
parent
31a204f1ea
commit
22eb82f7d2
1 changed files with 7 additions and 2 deletions
|
|
@ -12,11 +12,16 @@ extension FileDescriptionExtension on Event {
|
|||
return null;
|
||||
}
|
||||
final formattedBody = content.tryGet<String>('formatted_body');
|
||||
if (formattedBody != null) return formattedBody;
|
||||
if (formattedBody != null && formattedBody.isNotEmpty) return formattedBody;
|
||||
|
||||
final filename = content.tryGet<String>('filename');
|
||||
final body = content.tryGet<String>('body');
|
||||
if (filename != body && body != null && filename != null) return body;
|
||||
if (filename != body &&
|
||||
body != null &&
|
||||
filename != null &&
|
||||
body.isNotEmpty) {
|
||||
return body;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue