Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

New message: front-end#69

Open
tgomezzzz wants to merge 2 commits into
feature-groupchatfrom
new-message-frontend
Open

New message: front-end#69
tgomezzzz wants to merge 2 commits into
feature-groupchatfrom
new-message-frontend

Conversation

@tgomezzzz

Copy link
Copy Markdown
Contributor

This quick PR adds the input for typing new messages and fixes a bug in the fetch() statement.

@tgomezzzz
tgomezzzz requested review from Rmoneygit and angplee July 16, 2020 22:55
Comment thread src/main/webapp/script.js
return "<p>" + content + "</p>";
}

function newGroupchat() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GroupChat >:(
jk do what u want hehe just suggestion
idk u said before you'd change to just "Group" or smth but since group is its own thing i guess not
would be nice to also change Groupchat --> GroupChat 4 the class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer Groupchat, since it is just one word.

@angplee angplee Jul 30, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ITS 2 WORDS I SWEAR ;-;

Comment thread src/main/webapp/script.js
const key = urlParams.get('key');
fetch('/load-groupchat?key=' + key).then(response => response.json())
.catch(error => {
alert('Error: Groupchat does not exist');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooooh nice

Comment thread src/main/webapp/script.js
window.location.href = 'index.html';
}).then((messages) => {
const messageContainer = document.getElementById('messages');
messageContainer.innerHTML = '';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have a script injection concern :0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure, but I don't think so because the message's innerText is set, and not its innerHTML. I'm not sure if this makes it safe of a script injection though

@tgomezzzz
tgomezzzz requested review from adamtcohen and vidhyal August 4, 2020 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants