diff --git a/tarok/lib/main.dart b/tarok/lib/main.dart index a5ed7a1..419451e 100644 --- a/tarok/lib/main.dart +++ b/tarok/lib/main.dart @@ -44,7 +44,6 @@ import 'package:url_strategy/url_strategy.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - DiscordRPC.initialize(); setPathUrlStrategy(); @@ -78,6 +77,7 @@ void main() async { DISCORD_RPC = prefs.getBool("discordRpc") ?? true; if (!kIsWeb && (Platform.isLinux || Platform.isWindows) && DISCORD_RPC) { + DiscordRPC.initialize(); rpc.start(autoRegister: true); rpc.updatePresence( DiscordPresence( diff --git a/tarok/lib/settings.dart b/tarok/lib/settings.dart index 0cdbe30..7269220 100644 --- a/tarok/lib/settings.dart +++ b/tarok/lib/settings.dart @@ -138,6 +138,7 @@ class _SettingsState extends State { await prefs.setBool("discordRpc", value); DISCORD_RPC = prefs.getBool("discordRpc") ?? true; if (DISCORD_RPC) { + DiscordRPC.initialize(); rpc.start(autoRegister: true); rpc.updatePresence( DiscordPresence(