Skip to content

Commit

Permalink
Fixed message array slice
Browse files Browse the repository at this point in the history
  • Loading branch information
aki665 committed Mar 12, 2024
1 parent 185549b commit aaea992
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions screens/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Connected({
switch (object.type) {
case "color":
return {
type: "text",
type: "color",
text: object.text,
color: object.color,
key,
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function Connected({
return { type: "text", text: object.text, key };
}
});
console.log("revieved message", msg);
console.log("handled message", msg);
setMessages((prevState) => [...prevState, msg]);
};

Expand Down
2 changes: 1 addition & 1 deletion screens/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ChatLine = (
}[],
) => {
const msgPart = message[0];
const restOfMessage = message.slice(1, -1);
const restOfMessage = message.slice(1);
let style = chatStyles.message;
switch (msgPart.type) {
case "player":
Expand Down

0 comments on commit aaea992

Please sign in to comment.