Skip to content

Commit

Permalink
hotfix for android - do not crash (discordrpc)
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Dec 10, 2023
1 parent 3c9bba8 commit 4e9bcb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tarok/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import 'package:url_strategy/url_strategy.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
DiscordRPC.initialize();

setPathUrlStrategy();

Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tarok/lib/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class _SettingsState extends State<Settings> {
await prefs.setBool("discordRpc", value);
DISCORD_RPC = prefs.getBool("discordRpc") ?? true;
if (DISCORD_RPC) {
DiscordRPC.initialize();
rpc.start(autoRegister: true);
rpc.updatePresence(
DiscordPresence(
Expand Down

0 comments on commit 4e9bcb2

Please sign in to comment.