@ -1,5 +1,5 @@
|
||||
import { useTimelineStream } from './use-timeline-stream';
|
||||
|
||||
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId } as any);
|
||||
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId });
|
||||
|
||||
export { useGroupStream };
|
||||
|
||||
@ -9,7 +9,7 @@ import type { StreamingEvent } from 'pl-api';
|
||||
|
||||
const useTimelineStream = (
|
||||
stream: string,
|
||||
params: { list?: string; tag?: string } = {},
|
||||
params: { list?: string; tag?: string; group?: string } = {},
|
||||
enabled = true,
|
||||
listener?: (event: StreamingEvent) => any,
|
||||
) => {
|
||||
@ -26,6 +26,7 @@ const useTimelineStream = (
|
||||
params?: {
|
||||
list?: string;
|
||||
tag?: string;
|
||||
group?: string;
|
||||
},
|
||||
) => void;
|
||||
unsubscribe: (
|
||||
@ -33,6 +34,7 @@ const useTimelineStream = (
|
||||
params?: {
|
||||
list?: string;
|
||||
tag?: string;
|
||||
group?: string;
|
||||
},
|
||||
) => void;
|
||||
close: () => void;
|
||||
@ -61,7 +63,7 @@ const useTimelineStream = (
|
||||
socket.current?.subscribe(stream, params);
|
||||
|
||||
return () => socket.current?.unsubscribe(stream, params);
|
||||
}, [stream, params.list, params.tag, enabled]);
|
||||
}, [stream, params.list, params.tag, params.group, enabled]);
|
||||
|
||||
useEffect(() => {
|
||||
if (enabled) {
|
||||
|
||||
@ -43,7 +43,7 @@ const PollFooter: React.FC<IPollFooter> = ({
|
||||
const { toggleShowPollResults } = useStatusMetaActions();
|
||||
|
||||
const handleVote = () => {
|
||||
vote(Object.keys(selected) as any as number[]);
|
||||
vote(Object.keys(selected).map((optionId) => parseInt(optionId, 10)));
|
||||
};
|
||||
|
||||
const handleRefresh: React.EventHandler<React.MouseEvent> = (e) => {
|
||||
|
||||
@ -434,7 +434,7 @@ const Notification: React.FC<INotification> = (props) => {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}, [type, (notification as any).emoji]);
|
||||
}, [type, 'emoji' in notification && notification.emoji]);
|
||||
|
||||
const renderContent = () => {
|
||||
if (type === 'bite' && status) {
|
||||
|
||||
Reference in New Issue
Block a user