mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post form): default link label to 'link to file' on /all/ and /subs/
This commit is contained in:
@@ -324,7 +324,8 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid:
|
|||||||
const directoryEntry = useDirectoryByAddress(effectiveBoardAddress);
|
const directoryEntry = useDirectoryByAddress(effectiveBoardAddress);
|
||||||
const showSpoilerForPost = directoryEntry?.features?.noSpoilers !== true;
|
const showSpoilerForPost = directoryEntry?.features?.noSpoilers !== true;
|
||||||
const showSpoilerForReply = directoryEntry?.features?.noSpoilerReplies !== true;
|
const showSpoilerForReply = directoryEntry?.features?.noSpoilerReplies !== true;
|
||||||
const requirePostLinkIsMedia = directoryEntry?.features?.requirePostLinkIsMedia === true;
|
const requirePostLinkIsMediaFeature = directoryEntry?.features?.requirePostLinkIsMedia;
|
||||||
|
const requirePostLinkIsMedia = requirePostLinkIsMediaFeature === true || (requirePostLinkIsMediaFeature === undefined && (isInAllView || isInSubscriptionsView));
|
||||||
|
|
||||||
const { accountSubplebbits } = useAccountSubplebbits();
|
const { accountSubplebbits } = useAccountSubplebbits();
|
||||||
const accountSubplebbitAddresses = Object.keys(accountSubplebbits);
|
const accountSubplebbitAddresses = Object.keys(accountSubplebbits);
|
||||||
|
|||||||
@@ -35,9 +35,14 @@ interface ReplyModalProps {
|
|||||||
|
|
||||||
const ReplyModal = ({ closeModal, showReplyModal, parentCid, parentNumber, threadNumber, postCid, scrollY, subplebbitAddress }: ReplyModalProps) => {
|
const ReplyModal = ({ closeModal, showReplyModal, parentCid, parentNumber, threadNumber, postCid, scrollY, subplebbitAddress }: ReplyModalProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const location = useLocation();
|
||||||
|
const params = useParams();
|
||||||
|
const isInAllView = isAllView(location.pathname);
|
||||||
|
const isInSubscriptionsView = isSubscriptionsView(location.pathname, params);
|
||||||
const directoryEntry = useDirectoryByAddress(subplebbitAddress);
|
const directoryEntry = useDirectoryByAddress(subplebbitAddress);
|
||||||
const showSpoilerForReply = directoryEntry?.features?.noSpoilerReplies !== true;
|
const showSpoilerForReply = directoryEntry?.features?.noSpoilerReplies !== true;
|
||||||
const requirePostLinkIsMedia = directoryEntry?.features?.requirePostLinkIsMedia === true;
|
const requirePostLinkIsMediaFeature = directoryEntry?.features?.requirePostLinkIsMedia;
|
||||||
|
const requirePostLinkIsMedia = requirePostLinkIsMediaFeature === true || (requirePostLinkIsMediaFeature === undefined && (isInAllView || isInSubscriptionsView));
|
||||||
const { setPublishReplyOptions, publishReply, resetPublishReplyOptions, replyIndex } = usePublishReply({
|
const { setPublishReplyOptions, publishReply, resetPublishReplyOptions, replyIndex } = usePublishReply({
|
||||||
cid: parentCid,
|
cid: parentCid,
|
||||||
subplebbitAddress,
|
subplebbitAddress,
|
||||||
@@ -148,9 +153,6 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, parentNumber, threa
|
|||||||
}
|
}
|
||||||
}, [parentCid]);
|
}, [parentCid]);
|
||||||
|
|
||||||
const location = useLocation();
|
|
||||||
const isInAllView = isAllView(location.pathname);
|
|
||||||
const isInSubscriptionsView = isSubscriptionsView(location.pathname, useParams());
|
|
||||||
const currentTime = useCurrentTime();
|
const currentTime = useCurrentTime();
|
||||||
// Only subscribe to updatedAt to avoid rerenders from updatingState changes
|
// Only subscribe to updatedAt to avoid rerenders from updatingState changes
|
||||||
const updatedAt = useSubplebbitField(subplebbitAddress, (subplebbit) => subplebbit?.updatedAt);
|
const updatedAt = useSubplebbitField(subplebbitAddress, (subplebbit) => subplebbit?.updatedAt);
|
||||||
|
|||||||
Reference in New Issue
Block a user