From cbb3514c4a51378ba64fc1275aba2e8fbbe5aff8 Mon Sep 17 00:00:00 2001 From: mytja Date: Sat, 18 Nov 2023 00:16:57 +0100 Subject: [PATCH] hotfix for the web --- tarok/lib/constants.dart | 2 +- tarok/lib/game/game_controller.dart | 5 +++-- tarok/lib/main.dart | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tarok/lib/constants.dart b/tarok/lib/constants.dart index c213644..431173f 100644 --- a/tarok/lib/constants.dart +++ b/tarok/lib/constants.dart @@ -37,7 +37,7 @@ const WS_URL = kReleaseMode ? "wss://palcka.si/api/ws" : "ws://localhost:8080/ws"; const LOBBY_WS_URL = kReleaseMode ? "wss://palcka.si/api/lobby" : "ws://localhost:8080/lobby"; -const RELEASE = "0.0.6"; +const RELEASE = "Beta 0.0.7"; bool OMOGOCI_STOCKSKIS_PREDLOGE = true; bool SLEPI_TAROK = false; bool AVTOPOTRDI_ZALOZITEV = false; diff --git a/tarok/lib/game/game_controller.dart b/tarok/lib/game/game_controller.dart index 8e96e7e..2828f03 100644 --- a/tarok/lib/game/game_controller.dart +++ b/tarok/lib/game/game_controller.dart @@ -23,6 +23,7 @@ import 'dart:math'; import 'dart:typed_data'; import 'package:dart_discord_rpc/dart_discord_rpc.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_initicon/flutter_initicon.dart'; import 'package:get/get.dart'; @@ -126,7 +127,7 @@ class GameController extends GetxController { playingCount.value = playing; bots = bbots; - if (Platform.isLinux || Platform.isWindows) { + if (!kIsWeb && (Platform.isLinux || Platform.isWindows)) { rpc.updatePresence( DiscordPresence( details: 'Igra igro ${bots ? "z boti" : "z igralci"}', @@ -157,7 +158,7 @@ class GameController extends GetxController { void onClose() { controller.value.dispose(); - if (Platform.isLinux || Platform.isWindows) { + if (!kIsWeb && (Platform.isLinux || Platform.isWindows)) { rpc.updatePresence( DiscordPresence( details: 'Gleda na začetni zaslon', diff --git a/tarok/lib/main.dart b/tarok/lib/main.dart index 3bda453..8f472cc 100644 --- a/tarok/lib/main.dart +++ b/tarok/lib/main.dart @@ -16,6 +16,7 @@ import 'dart:io'; import 'package:dart_discord_rpc/dart_discord_rpc.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_inapp_notifications/flutter_inapp_notifications.dart'; @@ -44,7 +45,7 @@ import 'package:url_strategy/url_strategy.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - if (Platform.isLinux || Platform.isWindows) { + if (!kIsWeb && (Platform.isLinux || Platform.isWindows)) { DiscordRPC.initialize(); rpc.start(autoRegister: true); rpc.updatePresence(