From d1df7b48a3a90d1fd953e0045863cb12d18539d9 Mon Sep 17 00:00:00 2001 From: vvandenb Date: Sat, 18 Mar 2023 08:41:12 +0100 Subject: [PATCH] * Now closing user menu after sending DM --- front/volume/src/App.svelte | 2 +- front/volume/src/components/Chat.svelte | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index 836ef45..e90e99d 100644 --- a/front/volume/src/App.svelte +++ b/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", diff --git a/front/volume/src/components/Chat.svelte b/front/volume/src/components/Chat.svelte index 3085106..5a476e1 100644 --- a/front/volume/src/components/Chat.svelte +++ b/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; + } +
@@ -328,7 +333,7 @@ >
  • -