fix reply hover blocking bug

This commit is contained in:
ewwwwwwww 2022-06-17 12:39:17 -07:00
parent cc7058349f
commit 3299d0b972
6 changed files with 11 additions and 6 deletions

View file

@ -6,7 +6,7 @@ import { useDispatch } from 'react-redux';
import { import {
openStatusHoverCard, openStatusHoverCard,
closeStatusHoverCard, closeStatusHoverCard,
} from 'soapbox/actions/status_hover_card'; } from 'soapbox/actions/status-hover-card';
import { isMobile } from 'soapbox/is_mobile'; import { isMobile } from 'soapbox/is_mobile';
const showStatusHoverCard = debounce((dispatch, ref, statusId) => { const showStatusHoverCard = debounce((dispatch, ref, statusId) => {

View file

@ -8,15 +8,16 @@ import { fetchRelationships } from 'soapbox/actions/accounts';
import { import {
closeStatusHoverCard, closeStatusHoverCard,
updateStatusHoverCard, updateStatusHoverCard,
} from 'soapbox/actions/status_hover_card'; } from 'soapbox/actions/status-hover-card';
import ActionButton from 'soapbox/features/ui/components/action-button'; import ActionButton from 'soapbox/features/ui/components/action-button';
import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
import { UserPanel } from 'soapbox/features/ui/util/async-components'; import { UserPanel } from 'soapbox/features/ui/util/async-components';
import StatusContainer from 'soapbox/containers/status_container'; import StatusContainer from 'soapbox/containers/status_container';
import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
import { makeGetStatus } from 'soapbox/selectors'; import { makeGetStatus } from 'soapbox/selectors';
import { fetchStatus } from 'soapbox/actions/statuses';
import { showStatusHoverCard } from './hover_status_wrapper'; import { showStatusHoverCard } from './hover-status-wrapper';
import { Card, CardBody, Stack, Text } from './ui'; import { Card, CardBody, Stack, Text } from './ui';
import type { AppDispatch } from 'soapbox/store'; import type { AppDispatch } from 'soapbox/store';
@ -49,6 +50,10 @@ export const StatusHoverCard: React.FC<IStatusHoverCard> = ({ visible = true })
const statusId: string | undefined = useAppSelector(state => state.status_hover_card.statusId || undefined); const statusId: string | undefined = useAppSelector(state => state.status_hover_card.statusId || undefined);
const targetRef = useAppSelector(state => state.status_hover_card.ref?.current); const targetRef = useAppSelector(state => state.status_hover_card.ref?.current);
useEffect(() => {
if (statusId) dispatch(fetchStatus(statusId));
}, [dispatch, statusId])
useEffect(() => { useEffect(() => {
const unlisten = history.listen(() => { const unlisten = history.listen(() => {
showStatusHoverCard.cancel(); showStatusHoverCard.cancel();

View file

@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper';
import HoverStatusWrapper from 'soapbox/components/hover_status_wrapper'; import HoverStatusWrapper from 'soapbox/components/hover-status-wrapper';
import { useAppDispatch } from 'soapbox/hooks'; import { useAppDispatch } from 'soapbox/hooks';
import type { Account, Status } from 'soapbox/types/entities'; import type { Account, Status } from 'soapbox/types/entities';

View file

@ -53,7 +53,7 @@ import security from './security';
import settings from './settings'; import settings from './settings';
import sidebar from './sidebar'; import sidebar from './sidebar';
import soapbox from './soapbox'; import soapbox from './soapbox';
import status_hover_card from './status_hover_card'; import status_hover_card from './status-hover-card';
import status_lists from './status_lists'; import status_lists from './status_lists';
import statuses from './statuses'; import statuses from './statuses';
import suggestions from './suggestions'; import suggestions from './suggestions';

View file

@ -4,7 +4,7 @@ import {
STATUS_HOVER_CARD_OPEN, STATUS_HOVER_CARD_OPEN,
STATUS_HOVER_CARD_CLOSE, STATUS_HOVER_CARD_CLOSE,
STATUS_HOVER_CARD_UPDATE, STATUS_HOVER_CARD_UPDATE,
} from 'soapbox/actions/status_hover_card'; } from 'soapbox/actions/status-hover-card';
import type { AnyAction } from 'redux'; import type { AnyAction } from 'redux';