diff --git a/srcs/requirements/svelte/api_front/src/App.svelte b/srcs/requirements/svelte/api_front/src/App.svelte
index 9c848f74..f69889fe 100644
--- a/srcs/requirements/svelte/api_front/src/App.svelte
+++ b/srcs/requirements/svelte/api_front/src/App.svelte
@@ -4,18 +4,17 @@
import { location } from 'svelte-spa-router';
import Chat from './pieces/chat/Chat.svelte';
import Header from './pieces/Header.svelte';
+ import { showHeader } from './pieces/store_showHeader';
- const conditionsFailed = (event) => {
- console.error('conditionsFailed event', event.detail);
- // i mean i guess i can just leave this in there permanently?
-
- // replace('/unauthorized-access');
- replace('/');
- };
+ const conditionsFailed = (event) => {
+ console.error('conditionsFailed event', event.detail);
+ // replace('/unauthorized-access');
+ replace('/');
+ };
-{#if ($location !== '/')}
+{#if ($location !== '/' && $showHeader)}
{/if}
diff --git a/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte b/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte
index 855ef0c4..d02e162d 100644
--- a/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte
+++ b/srcs/requirements/svelte/api_front/src/pages/game/Game.svelte
@@ -9,6 +9,7 @@
import { gameState } from "./client/ws";
import { invited_username } from '../../pieces/store_invitation';
+ import { showHeader } from '../../pieces/store_showHeader';
//user's stuff
let user;
@@ -61,6 +62,7 @@
clearTimeout(value);
});
pong.destroy();
+ setHiddenGame(true);
})
function resetPage() {
@@ -73,6 +75,12 @@
pong.destroy();
};
+ function leaveMatch() {
+ clearInterval(watchMatchStartInterval);
+ clearInterval(watchGameStateInterval);
+ resetPage();
+ };
+
const initGame = async() =>
{
showWaitPage = true;
@@ -239,20 +247,18 @@
});
}
- function leaveMatch() {
- clearInterval(watchMatchStartInterval);
- clearInterval(watchGameStateInterval);
- resetPage();
- };
-
let game_page_class = "";
function setHiddenGame(value: boolean)
{
- if (value) {
+ if (value === true) {
game_page_class = "";
+ window.document.body.classList.remove('dim_background');
+ showHeader.set(true);
}
else {
game_page_class = "dim_background";
+ window.document.body.classList.add('dim_background');
+ showHeader.set(false);
}
hiddenGame = value;
}
@@ -323,7 +329,7 @@
{#if hiddenGame}
{#if showGameOptions}
-
+