mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-04 05:43:07 +00:00
fix: attempt to retrieve *any* message from store
This commit is contained in:
parent
2c5a1a192a
commit
cea5e76e74
@ -4,12 +4,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset='UTF-8' />
|
<meta charset='UTF-8' />
|
||||||
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
|
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
|
||||||
<title>JS-Waku unpkg example</title>
|
<title>JS-Waku store script tag example</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div><h1>Timestamp of latest relay ping</h1></div>
|
<div><h1>Timestamp of latest message seen in store</h1></div>
|
||||||
<div id='timestamp'></div>
|
<div id='timestamp'></div>
|
||||||
|
|
||||||
<script type='module'>
|
<script type='module'>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
if (latestMessage) {
|
if (latestMessage) {
|
||||||
timestampDiv.innerHTML = latestMessage.timestamp;
|
timestampDiv.innerHTML = latestMessage.timestamp;
|
||||||
} else {
|
} else {
|
||||||
timestampDiv.innerHTML = '<p>No ping message available</p>';
|
timestampDiv.innerHTML = '<p>No message available, go to <a href="https://js-waku.wakuconnect.dev/examples/web-chat/">web-chat</a> to send a message</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// When returning true, `queryHistory` stops retrieving pages
|
// When returning true, `queryHistory` stops retrieving pages
|
||||||
@ -61,8 +61,9 @@
|
|||||||
// Only retrieve a week of messages
|
// Only retrieve a week of messages
|
||||||
startTime.setTime(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
startTime.setTime(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
||||||
|
|
||||||
|
|
||||||
await node.store
|
await node.store
|
||||||
.queryHistory(['/relay-ping/1/ping/null'], {
|
.queryHistory([], {
|
||||||
callback,
|
callback,
|
||||||
pageDirection: 'backward',
|
pageDirection: 'backward',
|
||||||
pageSize: 1,
|
pageSize: 1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user