Browse Source

* Now closing user menu after sending DM

master
vvandenb 2 years ago
parent
commit
d1df7b48a3
  1. 2
      front/volume/src/App.svelte
  2. 9
      front/volume/src/components/Chat.svelte

2
front/volume/src/App.svelte

@ -113,7 +113,7 @@
DMChannel = await res.json();
if (DMChannel.length != 0)
chan.selectChat(DMChannel[0].id);
} else {
} else {
console.log("Creating DMChannel: " + $store.username + "&" + DMUsername)
fetch(API_URL + "/channels", {
credentials: "include",

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

@ -81,7 +81,7 @@
const dispatch = createEventDispatcher();
let showProfileMenu = false;
let selectedUser = null;
let selectedUser: string | null = null;
function openProfile(username: string) {
showProfileMenu = true;
selectedUser = username;
@ -301,7 +301,12 @@
}
}
function onSendMessage() {
dispatch("send-message", selectedUser);
showProfileMenu = false;
}
</script>
<div class="overlay">
<div class="chat" on:click|stopPropagation on:keydown|stopPropagation>
<div class="messages">
@ -328,7 +333,7 @@
>
<ul>
<li>
<button on:click={() => dispatch("send-message", selectedUser)}>
<button on:click={onSendMessage}>
Send Message
</button>
</li>

Loading…
Cancel
Save