Workaround the fact that ni-waku does not accept integers as timestamp

This commit is contained in:
Franck Royer 2021-08-05 13:32:37 +10:00
parent 5a4d7cfb09
commit d035359616
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 0 deletions

View File

@ -181,6 +181,11 @@ export class NimWaku {
let timestamp;
if (message.timestamp) {
timestamp = message.timestamp.valueOf() / 1000;
if (Number.isInteger(timestamp)) {
// Add a millisecond to ensure it's not an integer
// Until https://github.com/status-im/nim-waku/issues/691 is done
timestamp += 0.001;
}
}
const rpcMessage = {