diff --git a/src/Cursors.test.ts b/src/Cursors.test.ts index e51cb54a..e1e9c3fe 100644 --- a/src/Cursors.test.ts +++ b/src/Cursors.test.ts @@ -116,7 +116,7 @@ describe('Cursors', () => { vi.spyOn(channel.presence, 'get').mockImplementation(createPresenceCount(2)); await cursors['onPresenceUpdate'](); expect(batching.shouldSend).toBeTruthy(); - expect(batching.batchTime).toEqual(100); + expect(batching.batchTime).toEqual(200); }); it('batchTime is updated when multiple people are present', async ({ @@ -126,7 +126,7 @@ describe('Cursors', () => { }) => { vi.spyOn(channel.presence, 'get').mockImplementation(createPresenceCount(2)); await cursors['onPresenceUpdate'](); - expect(batching.batchTime).toEqual(100); + expect(batching.batchTime).toEqual(200); }); describe('pushCursorPosition', () => { diff --git a/src/Cursors.ts b/src/Cursors.ts index 34512b79..e3318bc2 100644 --- a/src/Cursors.ts +++ b/src/Cursors.ts @@ -76,7 +76,7 @@ export default class Cursors extends EventEmitter { const channel = this.getChannel(); const cursorsMembers = await channel.presence.get(); this.cursorBatching.setShouldSend(cursorsMembers.length > 1); - this.cursorBatching.setBatchTime((cursorsMembers.length - 1) * this.options.outboundBatchInterval); + this.cursorBatching.setBatchTime(cursorsMembers.length * this.options.outboundBatchInterval); } private isUnsubscribed() {