Skip to content

Commit

Permalink
chore: clear or disconnect discord on dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Sep 13, 2024
1 parent 4f88288 commit 40bfcc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/provider/discord_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ class DiscordNotifier extends AsyncNotifier<void> {
for (final subscription in subscriptions) {
subscription.cancel();
}
await clear();
await close();
await FlutterDiscordRPC.instance.dispose();
});

if (!enabled && FlutterDiscordRPC.instance.isConnected) {
await clear();
await close();
} else {
} else if (enabled) {
await FlutterDiscordRPC.instance.connect(autoRetry: true);
}
}
Expand Down

0 comments on commit 40bfcc1

Please sign in to comment.