Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-06-11 16:16:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e6c253cd0971e88b2a6387509f6d6d819d72dc8
3e6c253c
1 parent
8803269b
add empty array in useEffect
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
front/src/Routes/Chat/ChatPresenter.js
front/src/Routes/Chat/ChatPresenter.js
View file @
3e6c253
...
...
@@ -156,7 +156,7 @@ export default ({
})
=>
{
const
{
pathname
}
=
location
;
const
roomName
=
pathname
.
slice
(
1
,
pathname
.
length
);
useEffect
(()
=>
subscribeToNewMessage
());
useEffect
(()
=>
subscribeToNewMessage
()
,
[]
);
return
(
<
Wrapper
>
...
...
@@ -176,20 +176,18 @@ export default ({
<
/ChatMenuContainer
>
<
ChatScreenContainer
>
<
ChatScreenHeader
>
<
Title
>
Selected
Menu
Title
<
/Title
>
<
Title
>
{
roomName
}
<
/Title
>
<
/ChatScreenHeader
>
<
ChatScreenBox
>
<
ul
>
{
messageArray
&&
messageArray
.
seeAllMessage
.
map
((
e
)
=>
(
<
Message
text
=
{
e
.
text
}
time
=
{
e
.
createdAt
}
key
=
{
e
.
id
}
avatar
=
{
e
.
sender
.
avatarUrl
}
/
>
))}
<
/ul
>
{
messageArray
&&
messageArray
.
seeAllMessage
.
map
((
e
)
=>
(
<
Message
text
=
{
e
.
text
}
time
=
{
e
.
createdAt
}
key
=
{
e
.
id
}
avatar
=
{
e
.
sender
.
avatarUrl
}
/
>
))}
<
InputContainer
className
=
"InputContainer"
>
<
form
onSubmit
=
{
onSubmit
}
>
<
Input
...
...
Please
register
or
login
to post a comment