refactor: Avoid redundant async
This commit is contained in:
parent
9d007815df
commit
d08364688e
15 changed files with 153 additions and 166 deletions
|
|
@ -257,7 +257,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
void _loadDraft() async {
|
||||
void _loadDraft() {
|
||||
final prefs = Matrix.of(context).store;
|
||||
final draft = prefs.getString('draft_$roomId');
|
||||
if (draft != null && draft.isNotEmpty) {
|
||||
|
|
|
|||
|
|
@ -27,11 +27,7 @@ class PollWidget extends StatelessWidget {
|
|||
void _endPoll(BuildContext context) =>
|
||||
showFutureLoadingDialog(context: context, future: () => event.endPoll());
|
||||
|
||||
void _toggleVote(
|
||||
BuildContext context,
|
||||
String answerId,
|
||||
int maxSelection,
|
||||
) async {
|
||||
void _toggleVote(BuildContext context, String answerId, int maxSelection) {
|
||||
final userId = event.room.client.userID!;
|
||||
final answerIds = event.getPollResponses(timeline)[userId] ?? {};
|
||||
if (!answerIds.remove(answerId)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue