Browse Source

remove OpenChat store and related code

master
Pheuw1 2 years ago
parent
commit
1aaa904f57
  1. 3
      front/volume/src/App.svelte
  2. 1
      front/volume/src/components/Alert/content.ts
  3. 2
      front/volume/src/components/Channels.svelte
  4. 2
      front/volume/src/components/Chat.svelte

3
front/volume/src/App.svelte

@ -14,7 +14,6 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import { ChatOpen } from "./components/Alert/content";
import { onMount } from "svelte"; import { onMount } from "svelte";
import Navbar from "./components/NavBar.svelte"; import Navbar from "./components/NavBar.svelte";
import Modal from "svelte-simple-modal"; import Modal from "svelte-simple-modal";
@ -221,7 +220,6 @@
on:click={() => setAppState(APPSTATE.CHANNELS)} on:click={() => setAppState(APPSTATE.CHANNELS)}
on:keydown={() => setAppState(APPSTATE.CHANNELS)} on:keydown={() => setAppState(APPSTATE.CHANNELS)}
> >
{#if $ChatOpen}
<Chat <Chat
channel={selectedChannel} channel={selectedChannel}
on:view-profile={openIdProfile} on:view-profile={openIdProfile}
@ -229,7 +227,6 @@
on:invite-to-game={pong.inviteToGame} on:invite-to-game={pong.inviteToGame}
on:send-message={openDirectChat} on:send-message={openDirectChat}
/> />
{/if}
</div> </div>
{/if} {/if}
{#if appState.includes(APPSTATE.CHANNELS)} {#if appState.includes(APPSTATE.CHANNELS)}

1
front/volume/src/components/Alert/content.ts

@ -2,7 +2,6 @@ import { writable } from 'svelte/store';
import Alert__SvelteComponent_ from './Alert.svelte'; import Alert__SvelteComponent_ from './Alert.svelte';
export const content = writable("") export const content = writable("")
export const popup = writable(null) export const popup = writable(null)
export const ChatOpen = writable(false)
import { bind } from 'svelte-simple-modal'; import { bind } from 'svelte-simple-modal';
let val; let val;

2
front/volume/src/components/Channels.svelte

@ -14,7 +14,6 @@
import { API_URL, store } from "../Auth"; import { API_URL, store } from "../Auth";
import { socket } from "../socket"; import { socket } from "../socket";
import type User from "./Profile.svelte"; import type User from "./Profile.svelte";
import { ChatOpen } from "./Alert/content";
export async function formatChannelNames(channel: Array<ChannelsType>): Promise<void> { export async function formatChannelNames(channel: Array<ChannelsType>): Promise<void> {
const res = await fetch(API_URL + "/users/all", { const res = await fetch(API_URL + "/users/all", {
@ -79,7 +78,6 @@
ChannelId: id, ChannelId: id,
}); });
ChatOpen.set(true)
}; };
const getChannels = async () => { const getChannels = async () => {

2
front/volume/src/components/Chat.svelte

@ -10,7 +10,6 @@
import { show_popup, content } from "./Alert/content"; import { show_popup, content } from "./Alert/content";
import type { ChannelsType } from "./Channels.svelte"; import type { ChannelsType } from "./Channels.svelte";
import type User from "./Profile.svelte"; import type User from "./Profile.svelte";
import { ChatOpen } from "./Alert/content";
</script> </script>
<script lang="ts"> <script lang="ts">
@ -292,7 +291,6 @@
await show_popup("Press \"Okay\" to leave this channel?", false); await show_popup("Press \"Okay\" to leave this channel?", false);
if ($content == 'ok') { if ($content == 'ok') {
socket.emit('leaveChannel'); socket.emit('leaveChannel');
ChatOpen.set(false)
} }
} }
function onSendMessage() { function onSendMessage() {

Loading…
Cancel
Save