Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - 9 - chat. #222

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

WIP - 9 - chat. #222

wants to merge 3 commits into from

Conversation

robinlarsson
Copy link
Collaborator

@robinlarsson robinlarsson commented Apr 10, 2021

Done

  • Send message with push of enter.
  • Automatically scroll to bottom when sending a message.
  • Minimum 1 characters.
  • Maximum 100 characters.

TODO

  • Automatically scroll to bottom when receiving a message.

Related Issues

#16
#9

Closed

image

Default chat

image

Select another chat

image

@robinlarsson robinlarsson self-assigned this Apr 10, 2021
@robinlarsson robinlarsson added site-wide For common components and styling across all games enhancement New feature or request labels Apr 10, 2021
},
computed: {
chats() {
return this.$store.state.chat.chats;
Copy link
Owner

Choose a reason for hiding this comment

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

Using this.$store.state is not correct. See for example InviteScreen.vue for an example of how to use mapState to make reactivity work correctly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Perfect!

mutations: {
addChat(state, data) {
const { chatId, users } = data;
state.chats[chatId] = { chatId, users }
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to use Vue.set (see DslGameState.js for an example) in order to make the property reactive.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I didn't see that one yet, nice!

@robinlarsson robinlarsson requested a review from Zomis April 12, 2021 18:04
@Zomis
Copy link
Owner

Zomis commented Apr 16, 2021

Will wait with merging this until the backend is finished so that it can be tested more properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request site-wide For common components and styling across all games
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants