Browse Source

* svelte check stuff

master
vvandenb 2 years ago
parent
commit
cf0ae8fdc9
  1. 2
      front/src/components/Alert/Alert.svelte
  2. 4
      front/src/components/Channels.svelte
  3. 26
      front/src/components/Chat.svelte
  4. 2
      front/src/components/Pong/GameComponent.svelte

2
front/src/components/Alert/Alert.svelte

@ -1,5 +1,5 @@
<script lang="ts">
export let message;
export let message: string;
export let form = true;
export let passwordInput = false;
export let onCancel = () => {};

4
front/src/components/Channels.svelte

@ -35,7 +35,7 @@
mode: "cors",
})
if (res.ok) {
const users = await res.json()
const users: User[] = await res.json()
if (users) {
channel.forEach((channel) => {
let channelName = channel.name;
@ -47,7 +47,7 @@
const secondID = parseInt(split[1]);
let newChannelName = channelName;
users.forEach((user) => {
users.forEach((user: User) => {
if (user.ftId === firstID) {
newChannelName = newChannelName.replace(
split[0],

26
front/src/components/Chat.svelte

@ -325,32 +325,6 @@
//--------------------------------------------------------------------------------/
const unbanUser = async (username: string) => {
let response = await fetch(API_URL + "/users/" + username + "/byname", {
credentials: "include",
mode: "cors",
});
if (response.ok) {
const target = await response.json();
response = await fetch(API_URL + "/channels/" + channel.id + "/ban", {
credentials: "include",
method: "DELETE",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ id: target.ftId }),
});
}
if (response.ok) await show_popup("User unbanned", false);
else {
const error = await response.json();
await show_popup(error.message, false);
}
};
//--------------------------------------------------------------------------------/
const kickUser = async (username: string) => {
const response = await fetch(API_URL + "/users/" + username + "/byname", {
credentials: "include",

2
front/src/components/Pong/GameComponent.svelte

@ -1,7 +1,7 @@
<script lang="ts">
import type { Socket } from "socket.io-client";
import { onMount } from "svelte";
import { API_URL, getUser } from "../../Auth";
import { API_URL } from "../../Auth";
import { GAME_EVENTS } from "./constants";
import type { Game } from "./Game";

Loading…
Cancel
Save