Fill out the follower component

This commit is contained in:
Gabe Kangas
2022-05-03 14:17:05 -07:00
parent 2cfb336411
commit 008f607cf7
8 changed files with 70 additions and 26 deletions

View File

@@ -1,8 +1,8 @@
import { message } from 'antd';
import { SocketMessageType } from '../interfaces/socket-events';
import { MessageType } from '../interfaces/socket-events';
interface SocketMessage {
type: SocketMessageType;
type: MessageType;
data: any;
}
@@ -96,7 +96,7 @@ export default class WebsocketService {
}
// Send PONGs
if (message.type === SocketMessageType.PING) {
if (message.type === MessageType.PING) {
this.sendPong();
return;
}
@@ -106,7 +106,7 @@ export default class WebsocketService {
// Outbound: Other components can pass an object to `send`.
send(message: any) {
// Sanity check that what we're sending is a valid type.
if (!message.type || !SocketMessageType[message.type]) {
if (!message.type || !MessageType[message.type]) {
console.warn(`Outbound message: Unknown socket message type: "${message.type}" sent.`);
}
@@ -116,7 +116,7 @@ export default class WebsocketService {
// Reply to a PING as a keep alive.
sendPong() {
const pong = { type: SocketMessageType.PONG };
const pong = { type: MessageType.PONG };
this.send(pong);
}
}