File tree Expand file tree Collapse file tree 5 files changed +25
-6
lines changed Expand file tree Collapse file tree 5 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Changed
11+ - Test: Upgrade nim-waku node to v0.4.
12+ - Waku Light Push upgraded to ` 2.0.0-beta1 ` .
13+ - Examples (web chat): Catch error if chat message decoding fails.
14+ - Examples (web chat): Do not send message if shift/alt/ctrl is pressed, enabling multiline messages.
15+
1016## [ 0.6.0] - 2021-06-09
1117
1218### Changed
Original file line number Diff line number Diff line change @@ -12,9 +12,17 @@ export class Message {
1212
1313 static fromWakuMessage ( wakuMsg : WakuMessage ) : Message | undefined {
1414 if ( wakuMsg . payload ) {
15- const chatMsg = ChatMessage . decode ( wakuMsg . payload ) ;
16- if ( chatMsg ) {
17- return new Message ( chatMsg , wakuMsg . timestamp ) ;
15+ try {
16+ const chatMsg = ChatMessage . decode ( wakuMsg . payload ) ;
17+ if ( chatMsg ) {
18+ return new Message ( chatMsg , wakuMsg . timestamp ) ;
19+ }
20+ } catch ( e ) {
21+ console . error (
22+ 'Failed to decode chat message' ,
23+ wakuMsg . payloadAsUtf8 ,
24+ e
25+ ) ;
1826 }
1927 }
2028 return ;
Original file line number Diff line number Diff line change @@ -29,7 +29,12 @@ export default function MessageInput(props: Props) {
2929 } ;
3030
3131 const keyPressHandler = async ( event : KeyboardEvent < HTMLInputElement > ) => {
32- if ( event . key === 'Enter' ) {
32+ if (
33+ event . key === 'Enter' &&
34+ ! event . altKey &&
35+ ! event . ctrlKey &&
36+ ! event . shiftKey
37+ ) {
3338 await sendMessage ( ) ;
3439 }
3540 } ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { DefaultPubsubTopic } from '../waku_relay';
1010
1111import { PushRPC } from './push_rpc' ;
1212
13- export const LightPushCodec = '/vac/waku/lightpush/2.0.0-alpha1 ' ;
13+ export const LightPushCodec = '/vac/waku/lightpush/2.0.0-beta1 ' ;
1414export { PushResponse } ;
1515
1616export interface CreateOptions {
You can’t perform that action at this time.
0 commit comments