fix poll question not being displayed
This commit is contained in:
parent
e83ec63ded
commit
d8ec200b73
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
{"app_name":"extera_next","version":"2.0.1","package_name":"extera_next"}
|
{"app_name":"extera_next","version":"2.1.0","package_name":"extera_next"}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -217,7 +217,7 @@ class PollWidgetState extends State<PollWidget> {
|
||||||
final isDisclosed = kind == 'org.matrix.msc3381.disclosed';
|
final isDisclosed = kind == 'org.matrix.msc3381.disclosed';
|
||||||
final isEnded = _isPollEnded();
|
final isEnded = _isPollEnded();
|
||||||
|
|
||||||
return isDisclosed ? (isEnded || hasVoted) : isEnded;
|
return isDisclosed || isEnded;
|
||||||
}
|
}
|
||||||
|
|
||||||
double _getAnswerPercentage(String answerId) {
|
double _getAnswerPercentage(String answerId) {
|
||||||
|
|
@ -254,7 +254,7 @@ class PollWidgetState extends State<PollWidget> {
|
||||||
final event = widget.event;
|
final event = widget.event;
|
||||||
final content =
|
final content =
|
||||||
event.content[PollEvents.PollStart] as Map<String, dynamic?>;
|
event.content[PollEvents.PollStart] as Map<String, dynamic?>;
|
||||||
final question = content?['question']?['m.text'] as String? ?? 'Poll';
|
final question = content?['question']?['m.text'] as String? ?? content?['question']?['org.matrix.msc1767.text'] as String? ?? content?['question']?['body'] as String? ?? 'Poll';
|
||||||
final List<dynamic> answers = content?['answers'] ?? [];
|
final List<dynamic> answers = content?['answers'] ?? [];
|
||||||
final maxSelections = content?['max_selections'] as int? ?? 1;
|
final maxSelections = content?['max_selections'] as int? ?? 1;
|
||||||
final kind = content?['kind'] as String?;
|
final kind = content?['kind'] as String?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue