Skip to content

Commit

Permalink
fix: Avoid emit events for 'chat.poll_response' while is syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Oct 28, 2023
1 parent 61bdffc commit f5b4cb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/chat/events/registerPollEvent.ts
Expand Up @@ -22,12 +22,18 @@ import { getMessageById } from '../functions';

webpack.onFullReady(register);

const now = Date.now();

function register() {
wrapModuleFunction(upsertVotes, async (func, ...args) => {
const [data] = args;

for (const d of data) {
try {
if (d.senderTimestampMs < now) {
continue;
}

const msg = await getMessageById(d.parentMsgKey);
const selectedOptions: any = [];

Expand Down

0 comments on commit f5b4cb9

Please sign in to comment.