Skip to content

Commit

Permalink
🚑 Read message type
Browse files Browse the repository at this point in the history
  • Loading branch information
4fra committed Jan 5, 2025
1 parent 4e00565 commit 8f499df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Plutomierz/Plutomierz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const Plutomierz: React.FC = () => {

ws.onmessage = (event) => {
const data = JSON.parse(event.data);
setPlutaValue(data.value);
if (data.type === "pluta") {
setPlutaValue(data.value);
}
};

ws.onerror = (error) => {
Expand Down

0 comments on commit 8f499df

Please sign in to comment.