mirror of https://github.com/waku-org/js-waku.git
Merge pull request #206 from status-im/nim-waku-v0.4
This commit is contained in:
commit
c7991b3da2
|
@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Test: Upgrade nim-waku node to v0.4.
|
||||||
|
- Waku Light Push upgraded to `2.0.0-beta1`.
|
||||||
|
- Examples (web chat): Catch error if chat message decoding fails.
|
||||||
|
- Examples (web chat): Do not send message if shift/alt/ctrl is pressed, enabling multiline messages.
|
||||||
|
|
||||||
## [0.6.0] - 2021-06-09
|
## [0.6.0] - 2021-06-09
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -12,9 +12,17 @@ export class Message {
|
||||||
|
|
||||||
static fromWakuMessage(wakuMsg: WakuMessage): Message | undefined {
|
static fromWakuMessage(wakuMsg: WakuMessage): Message | undefined {
|
||||||
if (wakuMsg.payload) {
|
if (wakuMsg.payload) {
|
||||||
const chatMsg = ChatMessage.decode(wakuMsg.payload);
|
try {
|
||||||
if (chatMsg) {
|
const chatMsg = ChatMessage.decode(wakuMsg.payload);
|
||||||
return new Message(chatMsg, wakuMsg.timestamp);
|
if (chatMsg) {
|
||||||
|
return new Message(chatMsg, wakuMsg.timestamp);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(
|
||||||
|
'Failed to decode chat message',
|
||||||
|
wakuMsg.payloadAsUtf8,
|
||||||
|
e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -29,7 +29,12 @@ export default function MessageInput(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const keyPressHandler = async (event: KeyboardEvent<HTMLInputElement>) => {
|
const keyPressHandler = async (event: KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (event.key === 'Enter') {
|
if (
|
||||||
|
event.key === 'Enter' &&
|
||||||
|
!event.altKey &&
|
||||||
|
!event.ctrlKey &&
|
||||||
|
!event.shiftKey
|
||||||
|
) {
|
||||||
await sendMessage();
|
await sendMessage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
2
nim-waku
2
nim-waku
|
@ -1 +1 @@
|
||||||
Subproject commit 44cafcfee339bed7ff7d014e9cb3111d0c46c733
|
Subproject commit 5c58a19f4f50e207dcfbf34f4514cc7e88c709e5
|
|
@ -10,7 +10,7 @@ import { DefaultPubsubTopic } from '../waku_relay';
|
||||||
|
|
||||||
import { PushRPC } from './push_rpc';
|
import { PushRPC } from './push_rpc';
|
||||||
|
|
||||||
export const LightPushCodec = '/vac/waku/lightpush/2.0.0-alpha1';
|
export const LightPushCodec = '/vac/waku/lightpush/2.0.0-beta1';
|
||||||
export { PushResponse };
|
export { PushResponse };
|
||||||
|
|
||||||
export interface CreateOptions {
|
export interface CreateOptions {
|
||||||
|
|
Loading…
Reference in New Issue