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-16 20:23:22 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f3fe067bda27ff22035250c3528f2643e9f6b0a
0f3fe067
1 parent
186df69b
update ChatContainer
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
front/src/Routes/Chat/ChatContainer.js
front/src/Routes/Chat/ChatContainer.js
View file @
0f3fe06
...
...
@@ -11,7 +11,6 @@ import {
import
useInput
from
"../../Hooks/useInput"
;
import
{
toast
}
from
"react-toastify"
;
export
default
withRouter
(({
location
})
=>
{
const
[
messageArr
,
setMessageArr
]
=
useState
([]);
const
{
pathname
}
=
location
;
...
...
@@ -20,7 +19,7 @@ export default withRouter(({ location }) => {
const
message
=
useInput
(
""
);
let
messageObj
,
roomNum
,
messageArray
;
let
messageObj
,
roomNum
,
messageArray
;
// messageArray 는 useQuery 로 얻은 데이터 인데 undefined 가 아닌 데이터
const
{
data
:
getRoom
}
=
useQuery
(
GET_ROOM_BY_NAME
,
{
variables
:
{
roomName
},
...
...
@@ -36,7 +35,7 @@ export default withRouter(({ location }) => {
subscribeToMore
,
data
:
messageList
,
error
:
msgQueryError
,
loading
:
msgQuery
y
Loading
,
loading
:
msgQueryLoading
,
}
=
useQuery
(
SEE_ALL_MESSAGE
,
{
variables
:
{
roomId
:
roomNum
},
});
...
...
@@ -52,7 +51,7 @@ export default withRouter(({ location }) => {
if
(
messageArr
)
{
setMessageArr
(
messageArr
.
seeAllMessage
,
[
msgQueryError
,
messageArr
]);
}
},
[
msgQuery
y
Loading
]);
},
[
msgQueryLoading
]);
const
subscribeToNewMessage
=
()
=>
{
subscribeToMore
({
...
...
Please
register
or
login
to post a comment