From b6dc7d5dbadd694513e88bb29383f566b17dd87d Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 14 Sep 2021 14:09:09 +1000 Subject: [PATCH] Fix build --- packages/status-communities/src/chat.ts | 4 ++-- packages/status-communities/src/chat_message.ts | 7 +------ packages/status-communities/tsconfig.json | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) 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"],