@ -132,7 +132,7 @@
|
|||||||
"multiselect-react-dropdown": "^2.0.25",
|
"multiselect-react-dropdown": "^2.0.25",
|
||||||
"object-to-formdata": "^4.5.1",
|
"object-to-formdata": "^4.5.1",
|
||||||
"path-browserify": "^1.0.1",
|
"path-browserify": "^1.0.1",
|
||||||
"pl-api": "^0.0.13",
|
"pl-api": "^0.0.14",
|
||||||
"postcss": "^8.4.29",
|
"postcss": "^8.4.29",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"punycode": "^2.1.1",
|
"punycode": "^2.1.1",
|
||||||
|
|||||||
@ -47,11 +47,11 @@ const AccountGallery = () => {
|
|||||||
|
|
||||||
const handleScrollToBottom = () => {
|
const handleScrollToBottom = () => {
|
||||||
if (hasMore) {
|
if (hasMore) {
|
||||||
handleLoadMore(attachments.size > 0 ? attachments.last()!.status.id : null);
|
handleLoadMore();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLoadMore = (maxId: string | null) => {
|
const handleLoadMore = () => {
|
||||||
if (account) {
|
if (account) {
|
||||||
dispatch(fetchAccountTimeline(account.id, { only_media: true }, true));
|
dispatch(fetchAccountTimeline(account.id, { only_media: true }, true));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,7 +59,7 @@ const AccountTimeline: React.FC<IAccountTimeline> = ({ params, withReplies = fal
|
|||||||
}
|
}
|
||||||
}, [account?.id, withReplies]);
|
}, [account?.id, withReplies]);
|
||||||
|
|
||||||
const handleLoadMore = (maxId: string) => {
|
const handleLoadMore = () => {
|
||||||
if (account) {
|
if (account) {
|
||||||
dispatch(fetchAccountTimeline(account.id, { exclude_replies: !withReplies }, true));
|
dispatch(fetchAccountTimeline(account.id, { exclude_replies: !withReplies }, true));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,14 +40,10 @@ const HashtagTimeline: React.FC<IHashtagTimeline> = ({ params }) => {
|
|||||||
|
|
||||||
useHashtagStream(tagId);
|
useHashtagStream(tagId);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
dispatch(fetchHashtagTimeline(tagId));
|
|
||||||
dispatch(fetchHashtag(tagId));
|
|
||||||
}, [tagId]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(clearTimeline(`hashtag:${tagId}`));
|
dispatch(clearTimeline(`hashtag:${tagId}`));
|
||||||
dispatch(fetchHashtagTimeline(tagId, {}, true));
|
dispatch(fetchHashtag(tagId));
|
||||||
|
dispatch(fetchHashtagTimeline(tagId));
|
||||||
}, [tagId]);
|
}, [tagId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -15,13 +15,12 @@ import QuotedStatus from 'soapbox/features/status/containers/quoted-status-conta
|
|||||||
|
|
||||||
import StatusInteractionBar from './status-interaction-bar';
|
import StatusInteractionBar from './status-interaction-bar';
|
||||||
|
|
||||||
import type { Status as StatusEntity } from 'soapbox/normalizers';
|
|
||||||
import type { SelectedStatus } from 'soapbox/selectors';
|
import type { SelectedStatus } from 'soapbox/selectors';
|
||||||
|
|
||||||
interface IDetailedStatus {
|
interface IDetailedStatus {
|
||||||
status: SelectedStatus;
|
status: SelectedStatus;
|
||||||
withMedia?: boolean;
|
withMedia?: boolean;
|
||||||
onOpenCompareHistoryModal: (status: Pick<StatusEntity, 'id'>) => void;
|
onOpenCompareHistoryModal: (status: Pick<SelectedStatus, 'id'>) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DetailedStatus: React.FC<IDetailedStatus> = ({
|
const DetailedStatus: React.FC<IDetailedStatus> = ({
|
||||||
|
|||||||
@ -81,14 +81,12 @@ interface IThread {
|
|||||||
itemClassName?: string;
|
itemClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Thread = (props: IThread) => {
|
const Thread: React.FC<IThread> = ({
|
||||||
const {
|
|
||||||
itemClassName,
|
itemClassName,
|
||||||
status,
|
status,
|
||||||
useWindowScroll = true,
|
useWindowScroll = true,
|
||||||
withMedia = true,
|
withMedia = true,
|
||||||
} = props;
|
}) => {
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|||||||
@ -28,7 +28,7 @@ const BoostModal: React.FC<BaseModalProps & BoostModalProps> = ({ statusId, onRe
|
|||||||
|
|
||||||
const handleReblog = () => {
|
const handleReblog = () => {
|
||||||
onReblog(status);
|
onReblog(status);
|
||||||
onClose();
|
onClose('BOOST');
|
||||||
};
|
};
|
||||||
|
|
||||||
const buttonText = status.reblogged ? messages.cancel_reblog : messages.reblog;
|
const buttonText = status.reblogged ? messages.cancel_reblog : messages.reblog;
|
||||||
|
|||||||
@ -57,7 +57,7 @@ const EditFederationModal: React.FC<BaseModalProps & EditFederationModalProps> =
|
|||||||
.then(() => toast.success(intl.formatMessage(messages.success, { host })))
|
.then(() => toast.success(intl.formatMessage(messages.success, { host })))
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
onClose();
|
onClose('EDIT_FEDERATION');
|
||||||
};
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const getStatus = useCallback(makeGetStatus(), []);
|
const getStatus = useCallback(makeGetStatus(), []);
|
||||||
const status = useAppSelector((state) => getStatus(state, { id: statusId as string }));
|
const status = useAppSelector((state) => statusId ? getStatus(state, { id: statusId }) : undefined);
|
||||||
|
|
||||||
const [isLoaded, setIsLoaded] = useState<boolean>(!!status);
|
const [isLoaded, setIsLoaded] = useState<boolean>(!!status);
|
||||||
const [index, setIndex] = useState<number | null>(null);
|
const [index, setIndex] = useState<number | null>(null);
|
||||||
@ -185,16 +185,15 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Fetch the status (and context) from the API. */
|
|
||||||
const fetchData = () => dispatch(fetchStatusWithContext(status?.id as string, intl));
|
|
||||||
|
|
||||||
// Load data.
|
// Load data.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchData().then(() => {
|
if (status?.id) {
|
||||||
|
dispatch(fetchStatusWithContext(status.id, intl)).then(() => {
|
||||||
setIsLoaded(true);
|
setIsLoaded(true);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
setIsLoaded(true);
|
setIsLoaded(true);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}, [status?.id]);
|
}, [status?.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -245,7 +244,7 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
|
|||||||
<IconButton
|
<IconButton
|
||||||
title={intl.formatMessage(messages.close)}
|
title={intl.formatMessage(messages.close)}
|
||||||
src={require('@tabler/icons/outline/x.svg')}
|
src={require('@tabler/icons/outline/x.svg')}
|
||||||
onClick={() => onClose()}
|
onClick={() => onClose('MEDIA')}
|
||||||
theme='dark'
|
theme='dark'
|
||||||
className='!p-1.5 hover:scale-105 hover:bg-gray-900'
|
className='!p-1.5 hover:scale-105 hover:bg-gray-900'
|
||||||
iconClassName='h-5 w-5'
|
iconClassName='h-5 w-5'
|
||||||
|
|||||||
@ -126,7 +126,7 @@ const ReportModal = ({ onClose }: BaseModalProps) => {
|
|||||||
const cancelAction = () => {
|
const cancelAction = () => {
|
||||||
switch (currentStep) {
|
switch (currentStep) {
|
||||||
case Steps.ONE:
|
case Steps.ONE:
|
||||||
onClose();
|
onClose('REPORT');
|
||||||
break;
|
break;
|
||||||
case Steps.TWO:
|
case Steps.TWO:
|
||||||
setCurrentStep(Steps.ONE);
|
setCurrentStep(Steps.ONE);
|
||||||
@ -159,7 +159,7 @@ const ReportModal = ({ onClose }: BaseModalProps) => {
|
|||||||
break;
|
break;
|
||||||
case Steps.THREE:
|
case Steps.THREE:
|
||||||
dispatch(submitReportSuccess());
|
dispatch(submitReportSuccess());
|
||||||
onClose();
|
onClose('REPORT');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -8385,10 +8385,10 @@ pkg-types@^1.0.3:
|
|||||||
mlly "^1.2.0"
|
mlly "^1.2.0"
|
||||||
pathe "^1.1.0"
|
pathe "^1.1.0"
|
||||||
|
|
||||||
pl-api@^0.0.13:
|
pl-api@^0.0.14:
|
||||||
version "0.0.13"
|
version "0.0.14"
|
||||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.0.13.tgz#e13eb2a47ee4854cc6aa641bbefa6285f7b8d5fd"
|
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.0.14.tgz#71466b336482dc04739150b88b912bffa648d984"
|
||||||
integrity sha512-cyxMaK+IPUTQzMhODx9LZ+P/sMfLb6xu44RyZj7baJX/LSJj/YSMPqhV6xLQfjWm65HyPNOIDnz5hD6dA0v8/w==
|
integrity sha512-dRztsnvQDWlz3P3Rtpgi1fbMbt3SUJOwC2Pn+BnoZIc5lV84KbXQ0/LI5kfGFHATJkH3iTPtqSjVBnIxCYtTVw==
|
||||||
dependencies:
|
dependencies:
|
||||||
blurhash "^2.0.5"
|
blurhash "^2.0.5"
|
||||||
http-link-header "^1.1.3"
|
http-link-header "^1.1.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user