chat is on every pages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Router, { replace } from "svelte-spa-router";
|
||||
import { primaryRoutes } from "./routes/primaryRoutes.js";
|
||||
import Chat from './pieces/chat/Chat.svelte';
|
||||
|
||||
const conditionsFailed = (event) => {
|
||||
console.error('conditionsFailed event', event.detail);
|
||||
@@ -12,5 +13,6 @@
|
||||
|
||||
</script>
|
||||
|
||||
<Chat />
|
||||
<Router routes={primaryRoutes} on:conditionsFailed={conditionsFailed}/>
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
import GenerateUserDisplay from '../../pieces/GenerateUserDisplay.svelte';
|
||||
import { push } from 'svelte-spa-router';
|
||||
|
||||
import Chat from '../../pieces/chat/Chat.svelte';
|
||||
|
||||
let user;
|
||||
|
||||
onMount( async() => {
|
||||
@@ -17,8 +15,6 @@
|
||||
|
||||
</script>
|
||||
|
||||
<Chat color="bisque"/>
|
||||
|
||||
<div class="outer">
|
||||
{#if user !== undefined}
|
||||
<GenerateUserDisplay user={user}/>
|
||||
|
||||
@@ -2,14 +2,35 @@
|
||||
|
||||
import Layouts from './Chat_layouts.svelte';
|
||||
import { init_socket } from './Socket_chat';
|
||||
import { location } from 'svelte-spa-router';
|
||||
|
||||
export let color = "transparent";
|
||||
|
||||
init_socket();
|
||||
let color = "transparent";
|
||||
|
||||
console.log("location:",$location);
|
||||
if ($location !== '/')
|
||||
init_socket();
|
||||
|
||||
function change_color(loc)
|
||||
{
|
||||
console.log("change color, location:", loc);
|
||||
if (loc.startsWith("/game"))
|
||||
console.log("in change");
|
||||
if (loc.startsWith("/spectator"))
|
||||
console.log("in change");
|
||||
if (loc.startsWith("/ranking"))
|
||||
console.log("in change");
|
||||
if (loc.startsWith("/profile"))
|
||||
console.log("in change");
|
||||
}
|
||||
|
||||
$: change_color($location);
|
||||
|
||||
</script>
|
||||
|
||||
<Layouts color={color} />
|
||||
{#if $location !== '/'}
|
||||
<Layouts color={color} />
|
||||
{/if}
|
||||
|
||||
<style></style>
|
||||
|
||||
|
||||
@@ -56,9 +56,6 @@
|
||||
<Button on:click={game_invitation}>
|
||||
game invitation
|
||||
</Button>
|
||||
<Button>
|
||||
{block}
|
||||
</Button>
|
||||
|
||||
{#if back === "room_set"}
|
||||
<Button>
|
||||
|
||||
@@ -122,7 +122,7 @@ export async function invite_user(user_name: string)
|
||||
|
||||
export async function get_my_rooms()
|
||||
{
|
||||
to_print("in get_my_rooms");
|
||||
to_print("-------------------------------------------------------------------------------------------------------in get_my_rooms");
|
||||
|
||||
let response: FetchResponse = await fetch_chat_request('myrooms', FetchMethod.GET);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user