Skip to content

Commit

Permalink
Fix missed live data implementation of subgift event
Browse files Browse the repository at this point in the history
  • Loading branch information
seabeya committed May 21, 2024
1 parent fa0b341 commit ecd5e49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/sections/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export default function Logs({ item }: LogsProps) {
const handleSubscription = handle.onSubscription.bind(handle);
const handleResub = handle.onResub.bind(handle);
const handleCheer = handle.onCheer.bind(handle);
const handleSubgift = handle.onSubgift.bind(handle);

if (Spy.mode === 'Users') {
Spy.tmiClient.on('message', handleMessage);
}
Spy.tmiClient.on('subscription', handleSubscription);
Spy.tmiClient.on('resub', handleResub);
Spy.tmiClient.on('cheer', handleCheer);
Spy.tmiClient.on('submysterygift', handleSubgift);

// 200ms delay before showing the data:
setIsVisible(false);
Expand All @@ -56,6 +58,7 @@ export default function Logs({ item }: LogsProps) {
Spy.tmiClient.removeListener('subscription', handleSubscription);
Spy.tmiClient.removeListener('resub', handleResub);
Spy.tmiClient.removeListener('cheer', handleCheer);
Spy.tmiClient.removeListener('submysterygift', handleSubgift);
setMessageData(() => []);
clearTimeout(timeoutId);
};
Expand Down

0 comments on commit ecd5e49

Please sign in to comment.