From 968e71cbca28df16cdfd6e13060c997d42707b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 5 Jan 2022 14:32:02 +0100 Subject: [PATCH 1/2] Removing completely any analysis of the URL from the front. Instead, data related to room is sent from the admin, via the pusher. --- .../Components/ReportMenu/ReportMenu.svelte | 7 +++---- .../WarningContainer/WarningContainer.svelte | 4 +--- front/src/Connexion/ConnectionManager.ts | 11 +++------- front/src/Connexion/Room.ts | 14 +++++++++++++ front/src/Url/UrlManager.ts | 21 +++---------------- messages/JsonMessages/MapDetailsData.ts | 4 ++++ 6 files changed, 28 insertions(+), 33 deletions(-) diff --git a/front/src/Components/ReportMenu/ReportMenu.svelte b/front/src/Components/ReportMenu/ReportMenu.svelte index 8479a5b0..92601774 100644 --- a/front/src/Components/ReportMenu/ReportMenu.svelte +++ b/front/src/Components/ReportMenu/ReportMenu.svelte @@ -6,12 +6,11 @@ import type { Unsubscriber } from "svelte/store"; import { playersStore } from "../../Stores/PlayersStore"; import { connectionManager } from "../../Connexion/ConnectionManager"; - import { GameConnexionTypes } from "../../Url/UrlManager"; import { get } from "svelte/store"; let blockActive = true; let reportActive = !blockActive; - let anonymous: boolean = false; + let disableReport: boolean = false; let userUUID: string | undefined = playersStore.getPlayerById(get(showReportScreenStore).userId)?.userUuid; let userName = "No name"; let unsubscriber: Unsubscriber; @@ -26,7 +25,7 @@ } } }); - anonymous = connectionManager.getConnexionType === GameConnexionTypes.anonymous; + disableReport = !connectionManager.currentRoom?.canReport ?? true; }); onDestroy(() => { @@ -65,7 +64,7 @@ -
+