Browse Source

* Removed last alerts

master
vvandenb 2 years ago
parent
commit
aa5628d077
  1. 8
      front/volume/src/App.svelte
  2. 5
      front/volume/src/Auth.ts
  3. 4
      front/volume/src/components/Channels.svelte
  4. 5
      front/volume/src/components/Friends.svelte

8
front/volume/src/App.svelte

@ -24,7 +24,7 @@
import Chat from "./components/Chat.svelte";
import Channels, { formatChannelNames, type chatMessagesType } from "./components/Channels.svelte";
import Leaderboard from "./components/Leaderboard.svelte";
import { popup } from "./components/Alert/content";
import { popup, show_popup } from "./components/Alert/content";
import Pong from "./components/Pong/Pong.svelte";
import type { ChannelsType } from "./components/Channels.svelte";
import { API_URL } from "./Auth";
@ -115,13 +115,13 @@
await formatChannelNames(DMChannel)
setAppState(APPSTATE.CHANNELS + "#" + DMChannel[0].name)
} else {
alert("Error creating DM");
show_popup("Error: Couldn't create DM.", false)
}
} else {
alert("Error creating DM");
show_popup("Error: Couldn't create DM.", false)
}
}).catch(() => {
alert("Error creating DM");
show_popup("Error: Couldn't create DM.", false)
})
}
}

5
front/volume/src/Auth.ts

@ -1,4 +1,5 @@
import { writable } from "svelte/store";
import { show_popup } from "./components/Alert/content";
let _user = localStorage.getItem("user");
export const store = writable(_user ? JSON.parse(_user) : null);
@ -35,9 +36,9 @@ export function verify() {
mode: "cors",
credentials: "include",
});
alert(
show_popup(
"We have sent you an email to verify your account. Check the mailbox which is linked to your 42's profile."
);
, false);
}
export function logout() {

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

@ -1,7 +1,5 @@
<script lang="ts" context="module">
import { content, show_popup } from './Alert/content'
const showDialog = () => {
}
import { content, show_popup } from './Alert/content'
export interface ChannelsType {
id: number;

5
front/volume/src/components/Friends.svelte

@ -17,10 +17,10 @@
mode: "cors",
});
if (response.ok) {
alert("Invitation send.");
show_popup("Invitation send.", false);
} else {
const error = (await response.json()).message;
alert("Invitation failed: " + error);
show_popup("Invitation failed: " + error, false);
}
}
</script>
@ -28,6 +28,7 @@
<script lang="ts">
import { onMount, onDestroy } from "svelte";
import { API_URL, store } from "../Auth";
import { show_popup } from "./Alert/content";
let friends: Friend[] = [];
let invits: Friend[] = [];

Loading…
Cancel
Save