try to fix disposed errors when ending poll
This commit is contained in:
parent
2fc5a9bf85
commit
2580cc8c1c
1 changed files with 4 additions and 3 deletions
|
|
@ -75,6 +75,7 @@ class const PollRenderer(final Event event, final PollStart poll, {super.key})
|
|||
) async {
|
||||
pending.value = action;
|
||||
await send().onError(showError);
|
||||
if (!context.mounted) return;
|
||||
// Otherwise the old votes show until they're refetched
|
||||
await ref.read(votesProvider.future).onError((_, _) => const .new());
|
||||
if (context.mounted) pending.value = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue