mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
23 lines
733 B
TypeScript
23 lines
733 B
TypeScript
import { getAppDispatch } from '../../state/dispatch';
|
|
import { updateConversationSettingsModal } from '../../state/ducks/modalDialog';
|
|
import { useIsKickedFromGroup } from '../../hooks/useParamSelector';
|
|
import { openRightPanel } from '../../state/ducks/conversations';
|
|
|
|
export function useShowAttachments({ conversationId }: { conversationId: string }) {
|
|
const dispatch = getAppDispatch();
|
|
|
|
const isKickedFromGroup = useIsKickedFromGroup(conversationId);
|
|
|
|
if (isKickedFromGroup) {
|
|
// we can't show attachments if we are kicked from the group (no messages should be left )
|
|
return null;
|
|
}
|
|
|
|
const cb = () => {
|
|
dispatch(openRightPanel());
|
|
dispatch(updateConversationSettingsModal(null));
|
|
};
|
|
|
|
return cb;
|
|
}
|