diff --git a/public/js/chat.js b/public/js/chat.js index 6499300..71d128d 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -59,7 +59,7 @@ $(document).ready(async () => { const sendData = async () => { const jwt = getCookie("jwt"); - const author = (await fetch(`/api/getUsername`)).text() + const author = await (await fetch(`/api/getUsername`)).text() const content = $("#chat-input").val(); const message = { @@ -83,4 +83,4 @@ $(document).ready(async () => { }); $("#chat-input").bind("enterKey", sendData); -}); \ No newline at end of file +});