diff --git a/packages/status-communities/src/chat.ts b/packages/status-communities/src/chat.ts index f0682dd..dbef23a 100644 --- a/packages/status-communities/src/chat.ts +++ b/packages/status-communities/src/chat.ts @@ -9,7 +9,7 @@ export class Chat { this.id = id; } - public createMessage(text: string) { + private createMessage(text: string) { const { timestamp, clock } = this.nextClockAndTimestamp(); return ChatMessage.createMessage(clock, timestamp, text, this.id); @@ -33,7 +33,7 @@ export class Chat { this.lastMessage = message; } - if (this.lastClockValue < message.clock) { + if (!this.lastClockValue || this.lastClockValue < message.clock) { this.lastClockValue = message.clock; } } diff --git a/packages/status-communities/src/chat_message.ts b/packages/status-communities/src/chat_message.ts index c6715d1..a8c950a 100644 --- a/packages/status-communities/src/chat_message.ts +++ b/packages/status-communities/src/chat_message.ts @@ -1,10 +1,5 @@ import * as proto from "./proto/communities/v2/chat_message"; -import { - AudioMessage, - ChatMessage_ContentType, - ImageMessage, - StickerMessage, -} from "./proto/communities/v2/chat_message"; +import { ChatMessage_ContentType } from "./proto/communities/v2/chat_message"; import { MessageType } from "./proto/communities/v2/enums"; export class ChatMessage { diff --git a/packages/status-communities/tsconfig.json b/packages/status-communities/tsconfig.json index 5ae237f..281d2ca 100644 --- a/packages/status-communities/tsconfig.json +++ b/packages/status-communities/tsconfig.json @@ -38,7 +38,6 @@ "skipLibCheck": true, "lib": ["es2017", "dom"], - "types": ["node", "mocha"], "typeRoots": ["node_modules/@types", "src/types"] }, "include": ["src/**/*.ts"],