Skip to content

Commit 88a1904

Browse files
committed
Fix notification timestamps and filter queries by lastEventAck
1 parent 4d44e55 commit 88a1904

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/core-dojo/src/DojoNotificationStore.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class DojoNotificationStore implements NotificationStore {
8686
y: item["position.y"],
8787
},
8888
text: convertFullHexString(item.text),
89-
timestamp: Date.now(),
89+
timestamp: item.timestamp,
9090
};
9191
});
9292
},
@@ -189,14 +189,15 @@ export class DojoNotificationStore implements NotificationStore {
189189
export function createSqlQueryByRadius(
190190
center: Coordinate,
191191
radius: number,
192-
_lastEventAck: number,
192+
lastEventAck: number,
193193
address: string,
194194
) {
195195
console.log("add", address);
196196
let result = `SELECT
197-
"from", "to", "text", "position.x" , "position.y", "color"
197+
"from", "to", "text", "position.x" , "position.y", "color", "app", "timestamp"
198198
FROM "pixelaw-Notification"
199199
WHERE (("position.x" - ${center[0]}) * ("position.x" - ${center[0]}) + ("position.y" - ${center[1]}) * ("position.y" - ${center[1]})) <= (${radius} * ${radius})
200+
AND "timestamp" > ${lastEventAck}
200201
`;
201202

202203
result += ";";

0 commit comments

Comments
 (0)