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 lang="ts">
import { ChatOpen } from "./components/Alert/content";
import { onMount } from "svelte";
import Navbar from "./components/NavBar.svelte";
import Modal from "svelte-simple-modal";
@ -221,7 +220,6 @@
on:click={() => setAppState(APPSTATE.CHANNELS)}
on:keydown={() => setAppState(APPSTATE.CHANNELS)}
>
{#if $ChatOpen}
<Chat
channel={selectedChannel}
on:view-profile={openIdProfile}
@ -229,7 +227,6 @@
on:invite-to-game={pong.inviteToGame}
on:send-message={openDirectChat}
/>
{/if}
</div>
{/if}
{#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';
export const content = writable("")
export const popup = writable(null)
export const ChatOpen = writable(false)
import { bind } from 'svelte-simple-modal';
let val;

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

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

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

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

Loading…
Cancel
Save