-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored messages Array on client to use a Map (#341)
* Added `id` field to `Message` type on client and server * Error message for sending message when socket is closed * Refactored messages state from an `Array` to a `Map` * Removed unused import
- Loading branch information
1 parent
ee758ce
commit 5955203
Showing
7 changed files
with
52 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { Location } from "../types" | ||
|
||
export interface Message { | ||
author: string, | ||
timestamp: number, | ||
content: { | ||
text?: string, | ||
attachment?: string, | ||
}, | ||
location: Location, | ||
replyTo?: string, | ||
reactions: { | ||
[key: string]: number, | ||
} | ||
} | ||
id: string, | ||
author: string, | ||
timestamp: number, | ||
content: { | ||
text?: string, | ||
attachment?: string, | ||
}, | ||
location: Location, | ||
replyTo?: string, | ||
reactions: { | ||
[key: string]: number, | ||
} | ||
} |