Showing
1 changed file
with
5 additions
and
5 deletions
... | @@ -18,12 +18,12 @@ export default withRouter(({ location }) => { | ... | @@ -18,12 +18,12 @@ export default withRouter(({ location }) => { |
18 | 18 | ||
19 | if (roomName !== undefined) { | 19 | if (roomName !== undefined) { |
20 | const { data } = useQuery(GET_ROOM_BY_NAME, { variables: { roomName } }); | 20 | const { data } = useQuery(GET_ROOM_BY_NAME, { variables: { roomName } }); |
21 | - const { | 21 | + if (data !== undefined) { |
22 | - getRoomByName: { | 22 | + const { |
23 | getRoomByName: { id: roomId }, | 23 | getRoomByName: { id: roomId }, |
24 | - }, | 24 | + } = data; |
25 | - } = data; | 25 | + roomNum = Number(roomId); |
26 | - roomNum = Number(roomId); | 26 | + } |
27 | } | 27 | } |
28 | 28 | ||
29 | const [createMsg] = useMutation(WHOLE_MESSAGE); | 29 | const [createMsg] = useMutation(WHOLE_MESSAGE); | ... | ... |
-
Please register or login to post a comment