nicolium: types

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-02-27 01:47:11 +01:00
parent 45030f942e
commit 9c2d7b3788
4 changed files with 7 additions and 5 deletions

View File

@ -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 };

View File

@ -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) {

View File

@ -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) => {

View File

@ -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) {