mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-26 20:30:07 +00:00
Merge pull request #280 from status-im/timestamp-chat
Demonstrate usage of history time filter in web chat
This commit is contained in:
commit
37b8056a78
@ -61,10 +61,20 @@ async function retrieveStoreMessages(
|
||||
setArchivedMessages(messages);
|
||||
};
|
||||
|
||||
const startTime = new Date();
|
||||
// Only retrieve a week of history
|
||||
startTime.setTime(Date.now() - 1000 * 60 * 60 * 24 * 7);
|
||||
|
||||
const endTime = new Date();
|
||||
|
||||
try {
|
||||
const res = await waku.store.queryHistory([ChatContentTopic], {
|
||||
pageSize: 5,
|
||||
direction: Direction.FORWARD,
|
||||
timeFilter: {
|
||||
startTime,
|
||||
endTime,
|
||||
},
|
||||
callback,
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user