diff --git a/app/soapbox/actions/status_hover_card.js b/app/soapbox/actions/status-hover-card.js similarity index 100% rename from app/soapbox/actions/status_hover_card.js rename to app/soapbox/actions/status-hover-card.js diff --git a/app/soapbox/components/hover_status_wrapper.tsx b/app/soapbox/components/hover-status-wrapper.tsx similarity index 97% rename from app/soapbox/components/hover_status_wrapper.tsx rename to app/soapbox/components/hover-status-wrapper.tsx index 580fdaaf9..6860762e7 100644 --- a/app/soapbox/components/hover_status_wrapper.tsx +++ b/app/soapbox/components/hover-status-wrapper.tsx @@ -6,7 +6,7 @@ import { useDispatch } from 'react-redux'; import { openStatusHoverCard, closeStatusHoverCard, -} from 'soapbox/actions/status_hover_card'; +} from 'soapbox/actions/status-hover-card'; import { isMobile } from 'soapbox/is_mobile'; const showStatusHoverCard = debounce((dispatch, ref, statusId) => { diff --git a/app/soapbox/components/status-hover-card.tsx b/app/soapbox/components/status-hover-card.tsx index a68bfd9fa..379d4b6e2 100644 --- a/app/soapbox/components/status-hover-card.tsx +++ b/app/soapbox/components/status-hover-card.tsx @@ -8,15 +8,16 @@ import { fetchRelationships } from 'soapbox/actions/accounts'; import { closeStatusHoverCard, updateStatusHoverCard, -} from 'soapbox/actions/status_hover_card'; +} from 'soapbox/actions/status-hover-card'; import ActionButton from 'soapbox/features/ui/components/action-button'; import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; import { UserPanel } from 'soapbox/features/ui/util/async-components'; import StatusContainer from 'soapbox/containers/status_container'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; 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 type { AppDispatch } from 'soapbox/store'; @@ -49,6 +50,10 @@ export const StatusHoverCard: React.FC = ({ visible = true }) const statusId: string | undefined = useAppSelector(state => state.status_hover_card.statusId || undefined); const targetRef = useAppSelector(state => state.status_hover_card.ref?.current); + useEffect(() => { + if (statusId) dispatch(fetchStatus(statusId)); + }, [dispatch, statusId]) + useEffect(() => { const unlisten = history.listen(() => { showStatusHoverCard.cancel(); diff --git a/app/soapbox/components/status-reply-mentions.tsx b/app/soapbox/components/status-reply-mentions.tsx index f52c6c7fd..3a287344a 100644 --- a/app/soapbox/components/status-reply-mentions.tsx +++ b/app/soapbox/components/status-reply-mentions.tsx @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'; import { openModal } from 'soapbox/actions/modals'; 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 type { Account, Status } from 'soapbox/types/entities'; diff --git a/app/soapbox/reducers/index.ts b/app/soapbox/reducers/index.ts index 7c907de75..b0d3ee03f 100644 --- a/app/soapbox/reducers/index.ts +++ b/app/soapbox/reducers/index.ts @@ -53,7 +53,7 @@ import security from './security'; import settings from './settings'; import sidebar from './sidebar'; 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 statuses from './statuses'; import suggestions from './suggestions'; diff --git a/app/soapbox/reducers/status_hover_card.ts b/app/soapbox/reducers/status-hover-card.ts similarity index 95% rename from app/soapbox/reducers/status_hover_card.ts rename to app/soapbox/reducers/status-hover-card.ts index 80169ab85..11c660592 100644 --- a/app/soapbox/reducers/status_hover_card.ts +++ b/app/soapbox/reducers/status-hover-card.ts @@ -4,7 +4,7 @@ import { STATUS_HOVER_CARD_OPEN, STATUS_HOVER_CARD_CLOSE, STATUS_HOVER_CARD_UPDATE, -} from 'soapbox/actions/status_hover_card'; +} from 'soapbox/actions/status-hover-card'; import type { AnyAction } from 'redux';