sdy

update data destructuring

...@@ -18,13 +18,13 @@ export default withRouter(({ location }) => { ...@@ -18,13 +18,13 @@ 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 + if (data !== undefined) {
21 const { 22 const {
22 - getRoomByName: {
23 getRoomByName: { id: roomId }, 23 getRoomByName: { id: roomId },
24 - },
25 } = data; 24 } = data;
26 roomNum = Number(roomId); 25 roomNum = Number(roomId);
27 } 26 }
27 + }
28 28
29 const [createMsg] = useMutation(WHOLE_MESSAGE); 29 const [createMsg] = useMutation(WHOLE_MESSAGE);
30 //const { data } = useSubscription(SUBSCRIPTION_MSG); 30 //const { data } = useSubscription(SUBSCRIPTION_MSG);
......